For the code:

#model
db.define_table('container',
  Field('type','string',requires=IS_IN_SET(['cup','bowl','tank'])),
  Field('title', 'string', length=255)
  Field('description', 'text'),
)

#controller
def new_tank():
    form = SQLFORM(db.container)
    if form.process().accepted:
        response.flash = 'New Question Successful'
    elif form.errors:
        response.flash = 'Oops there are errors'
    return dict(form=form)

I want to set a default db.container.type in controller, in this case,
"tank".
i.e. the vars inserted into the db includes type="tank", but this is
not shown to the user filling up the form (I don't want it to be
tampered by the user).
It is a fixed value for type (in another function, it takes a
different fixed value)
How can I do this with form.process() or form.accepts()? (or other
better ways?)

Thanks!

Reply via email to