How about this?

record = db.table[id]
newfieldvalues = {'field_X':'value', ....}
if record.field_X == 'B': del newfieldvalues['field_X']
record.update_record(**newfieldvalues)


if db.table[id].field_X == A:
   #perform full update
elif db.table[id].field_X == B:
   #update all fields except field_X



On Sunday, 21 July 2013 08:11:44 UTC-5, lesssugar wrote:
>
> When going to update page I would like to check the value of field_X. 
> Then, depending on its current value, field_X should be updated along with 
> the other fields OR be excluded from upload:
>
> if db.table[id].field_X == A:
>    #perform full update
> elif db.table[id].field_X == B:
>    #update all fields except field_X
>
> Not sure how to achieve this. Ideas?
>

-- 

--- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to