[SQLObject] Re: Question about multiple deletes
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Chris G. <ch...@il...> - 2004-02-19 21:55:32
|
"David McNab" <da...@re...> wrote in message news:402...@re...... > What's the best way, within SQLObject, to delete an entire results set > from a table? > > In other words, the equivalent of an SQL query like: > > DELETE FROM mytable WHERE last_name = 'Jones' AND age > 50 > > I know I can iterate through an SQLObject result set and invoke > .destroySelf() on every element, but this feels painfully inefficient. There's nothing in SQLObject right now that does this, but you could add your own method pretty easily... Just add a function to the SQLObject class called .multiDelete() or something, which works the same as .select().. (i.e. takes in the same parameters... obviously it would do something quite different. ;) |