[sqlalchemy] adding/deleting list of objects -- feature request/proposal

2010-02-26 Thread Marcin Krol
Hello Michael, When I do: cities = session.query(City).all() session.delete(cities) I get: sqlalchemy.orm.exc.UnmappedInstanceError: Class '__builtin__.list' is not mapped Unless it's some sort of a problem, it would be nifty of SQLAlchemy to be able to add/delete in a session a

Re: [sqlalchemy] adding/deleting list of objects -- feature request/proposal

2010-02-26 Thread Alexandre Conrad
How about just a: cities = session.query(City).all() for city in cities: session.delete(city) or for city in session.query(City): #actually fires the query session.delete(city) or even (never tried that, read from the docs): session.query(City).delete() Alex 2010/2/26 Marcin Krol

Re: [sqlalchemy] adding/deleting list of objects -- feature request/proposal

2010-02-26 Thread Marcin Krol
Alexandre Conrad wrote: How about just a: cities = session.query(City).all() for city in cities: session.delete(city) or for city in session.query(City): #actually fires the query session.delete(city) Sure, it can be done and I'm doing that: I'm just saying that it wouldn't hurt

Re: [sqlalchemy] adding/deleting list of objects -- feature request/proposal

2010-02-26 Thread Alexandre Conrad
2010/2/26 Marcin Krol mrk...@gmail.com: Sure, it can be done and I'm doing that: I'm just saying that it wouldn't hurt if you could pass a list to session.add or session.delete instead of handing objects over one by one. For adding, there's the .add_all(instances) method available. There's no