King Simon wrote:
> The 'object_session' function returns the session that an object is
> currently associated with. I would have thought that you could write
> your destroySelf method as:

> def destroySelf(self):
>    db_session = object_session(self)
>    db_session.delete(self)

I have tried using Session.object_session(self) as you recommended but it
always returns "None". My Session class is defined as:

Session = scoped_session(
    sessionmaker(bind=db_engine, autoflush=True, transactional=True)
)

Thanks for help!


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

Reply via email to