Tried 4 different places and methods to get the number "1" into
field partyTypeID. What is the correct syntax?
thanks,
Alex Glaros
def add_new_person():
## form.vars.partyTypeID.default = 1 ########### tried this
db.auth_user.partyID.readable = db.auth_user.partyID.writable = False
## don't let user see field thinking they have to fill it in
db.Party.partyTypeID.readable = db.Party.partyTypeID.writable = False
## don't let user see field thinking they have to fill it in
form=SQLFORM.factory(db.Party,db.auth_user)
if form.process().accepted:
partyID = db.Party.insert(**db.Party._filter_fields(form.vars))
form.vars.partyID=partyID
partyID =
db.auth_user.insert(**db.auth_user._filter_fields(form.vars))
## form.element(_name='partyTypeID').update_record(_value=1) ###########
tried this
## update_record(partyTypeID=1) ########### tried this
## form.vars.partyTypeID=1 ########### tried this
response.flash='Thanks for filling the form'
return dict(form=form)
--
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.