Thread: [SQLObject] SQLBuilder / Update
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: <sw...@fr...> - 2004-04-02 20:36:58
|
Hi, How can I use sqlbuilder.Update() to simply update sqlobjects given =20 their ID ? I have some methods like: def updateBandImageWithID(self, bandID, imageFile): # And to avoid fetching the Band Object, something like: r =3D Update(Band.q,{'cover_file': imageFile}, where=3DBand.q.id =3D=3D bandID) But I get errors about connection set to None. I don't want to pass Band objects to methods. I've read the SQLBuilder doco and code, but couldn't make Update() work. Am I wrong trying to do such things ? PS: I'm using 0.5.2's version. But planning to switch to svn trunk -- Philippe Normand |
From: Ian B. <ia...@co...> - 2004-04-02 21:00:29
|
sw...@fr... wrote: > How can I use sqlbuilder.Update() to simply update sqlobjects given > their ID ? I forgot that was even in there. sqlbuilder.Update is more for generic construction of SQL queries, it's not intended to be used with SQLObject as a whole. sqlbuilder preceded SQLObject, which is where that came from. Ian |