You may also consider using a request, just to remind what 1 mean :

db.Party.partyTypeID.default = db(db.auth_user.email == 'email').select(
db.auth_user.id).first().id

Richard


On Wed, Apr 17, 2013 at 11:02 AM, Richard Vézina <
[email protected]> wrote:

> db.Party.partyTypeID.default = 1
>
> At the begining of your fucntion should work
>
> Richard
>
>
> On Wed, Apr 17, 2013 at 10:58 AM, Alex Glaros <[email protected]>wrote:
>
>> 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.
>>
>>
>>
>
>

-- 

--- 
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.


Reply via email to