I'd look at inspect(MyClass).relationships to see where the linkages are to other classes. Then you can probe those for the features you need - once you have one, it has a string "key". you can then see that by just getattr(someobj, "somekey").
On Jul 15, 2014, at 3:40 PM, Scott Meisburger <smeisbur...@gmail.com> wrote: > I've got an app where through an admin interface, a user can delete objects > in the database. This happens via: > > db.session.delete(obj) > db.session.commit() > > There are cascade rules defined in Python for these objects (using the ORM). > What I want to do is display to the user a list of related objects that will > be deleted along with the parent and have them confirm Yes or No. At the very > least, I'd like to be able to say whether or not there are ANY related > objects which will be deleted. I assume this can be done via some > introspection feature? > > -- > 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 sqlalchemy+unsubscr...@googlegroups.com. > To post to this group, send email to sqlalchemy@googlegroups.com. > Visit this group at http://groups.google.com/group/sqlalchemy. > For more options, visit https://groups.google.com/d/optout. -- 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 sqlalchemy+unsubscr...@googlegroups.com. To post to this group, send email to sqlalchemy@googlegroups.com. Visit this group at http://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.