I've got a table with two fields, an account name and a user id.
They're both required.
I want something like this:
naform = SQLFORM(db.acct, fields=['acct_name'],
hidden=dict(user_id=auth.user.id))
if naform.accepts(request.vars, session):
response.flash = 'Account %s created' % request.vars.acct_name
elif naform.errors:
response.flash = 'Account not created'
where the user will fill in the account name, and the form will
provide the user id. But of course the logic doesn't see a hidden
input as a table field, so naform.accepts() fails because user_id is
missing.
OTOH, if I include user_id in fields, then it gets displayed, which is
not what I want either.
(Also, the missing field raises an exception; is that expected?)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---