On Monday, May 9, 2011 10:45:36 AM UTC-4, niknok wrote: 
>
> I have these lines that is supposed to update a record but it doesn't: 
>
>     db.card.validated.writable=True
>     db.card.modified_by.writable=True
>     
> db.card(db.card.alnum==c_hash).update(validated=True,modified_by=auth.user.id)
>
>
> Is there anything I missed? I tried to include a manual db.commit(), but 
> that didn't work either. 
>
 
You can use the db.card(db.card.alnum==c_hash) notation to fetch a row 
(though I think you have to include the record ID as the first argument), 
but I'm not sure you can use it to update a record. For that, you may have 
to use the usual query notation: db(db.card.alum==c_hash).update(...). You 
might also be able to use your original notation along with update_record, 
but I don't see any reason to prefer that over the usual method.
 
Anthony

Reply via email to