On Thursday, November 17, 2011 11:01:34 AM UTC-5, Dominique wrote:
>
> Hello,
>
> Chapter 6 explains manual upoloads.
>
> >>> db.define_table('myfile',Field('image','upload'))
> >>> stream = open(filename,'rb')
> >>> db.myfile.insert(image=db.myfile.image.store(stream,filename))
> That works fine when the table is empty.
>
> But how to upload an image file in order to update a specific row (ie.
> when the other fields of the row are already filled in the db) ?
>
Did the usual update method(s) not work?
db(db.myfile.id == id).update(image=db.myfile.image.store(stream,filename))
or
db.myfile[id] = dict(image=db.myfile.image.store(stream,filename))
Anthony