Hi all,

Please  help me with the problem of dropdown selection.
It work fin by default:  select blank option in the drop down, it update 
value of field reference = None
But i need change drop down list: form[0][0][1] = TD(my_select) 
Now, it update value = 0 (not None) and I can't update: 
db(db.tablegroup.id==form.vars.id).update(field=None)
How i use None instead 0 ?

MODEL:

db.define_table('tablegroup', 
    Field('parent', 'reference tablegroup', requires = 
IS_NULL_OR(IS_IN_DB(db, 'tablegroup.id', '%(name)s', zero=None))),
    Field('name', unique=True),
    migrate=True)

CONTROL:

def create():
    form=crud.create(db.tablegroup)
    form[0][0][1] = TD(my_select)  
    if form.accepts(request.vars, session): pass
    return dict(form=form)

Reply via email to