editing the cascade isn't an option.
for now this seems to work, though it's ugly.
def recursive_expunge(obj, dbSession):
def _recursive_expunge(_obj):
if hasattr(_obj, '__mapper__'):
for rel in obj.__mapper__.relationships:
try:
dbSession.expunge(rel)
except sqlalchemy.orm.exc.UnmappedInstanceError:
pass
_recursive_expunge(obj)
recursive_expunge(postingObject, self.request.dbSession.writer)
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.