2010/4/14 Sebastian Elsner <sebast...@risefx.com>:
> I am unsure on how to delete correctly. Lets say I have a query's result,
> which is a list. del list[5] does not seem to do anything, right? I would
> always have to do session.delete(list[5])?

Correct. del list[5] only delete the instance in memory. If you want
to delete from the database, you have to explicitly tell the session
using its .delete() method.

> But what about when I created a mapped object, which is not yet persistent,
> how would I delete that? Just del someobject?

If it's not yet added to the Session, you can just "del someobject" or
let the GC make the job for you, if that makes sens in your scenario.

-- 
Alex
twitter.com/alexconrad

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to