>
>     db.lecture_items.fileetag.writable = True
>     upload = db(db.lecture_items.id==uidi).select().first()
>     upload.update(fileetag='%s' % request.vars.etag)
>     db.commit()
>

First, the writable attribute only determines whether the field will be 
displayed and editable in SQLFORMs -- you don't have to set it to do a 
manual update.

As for the update, the upload object you have created is a Row object. If 
you call the .update() method on it, you will only update the Row object 
itself, not the original record in the db. To update the db record, you 
have to do upload.update_record(...) -- see 
http://web2py.com/books/default/chapter/29/6#update_record. Also, if you 
don't need to do anything with the Row object (i.e., all you need to do is 
update the record), then no need to create the Row object to begin with -- 
just use the .update() method on the Set object:

db(db.lecture_items.id==uidi).update(fileetag='%s' % request.vars.etag)

Finally, if this is happening in a regular application request (i.e., not 
in a background process script or shell), you don't need db.commit().

Anthony

Reply via email to