I might be trying to do something unsupported here, but I'm trying to build
subselects with SQLBuilder.Select, and the queries mutate everytime they are
used:
>>> from SQLObject.SQLBuilder import Select
>>> q = Select([Work.q.composerID], where=Work.q.id==5)
>>> q
SELECT work.composer_id FROM work WHERE (work.id = 5)
>>> q
SELECT work.composer_id, (work.id = 5) FROM work WHERE (work.id = 5)
>>> q
SELECT work.composer_id, (work.id = 5), (work.id = 5) FROM work WHERE
(work.id = 5)
This is with SQLObject 0.5.
Dave Cook
|