[sqlalchemy] InstrumentedList/InstrumentedAttribute to dynamic query

2011-08-22 Thread Ahmed
Hello, I wonder if there is a possibility given an object instance (say with an InstrumentedList of a relationship attribute).. to get a corresponding dynamic query of this same InstrumentedList (the List was configured in the declarative class with a lazy loader and not a dynamic loader)??

[sqlalchemy] Relations reading/writing

2011-08-22 Thread Matthias
Hello, I am (ab)using sqlalchemy for versioning all my content. It allows me to do things like session.query(Parent).options(VersionOption(target_version = 123)).filter(Parent.children.any(Child.name == 'c1')).all() and the result will reflect exactly the state at version 123. The querying

Re: [sqlalchemy] Relations reading/writing

2011-08-22 Thread Michael Bayer
On Aug 22, 2011, at 12:15 PM, Matthias wrote: Hello, I am (ab)using sqlalchemy for versioning all my content. It allows me to do things like session.query(Parent).options(VersionOption(target_version = 123)).filter(Parent.children.any(Child.name == 'c1')).all() and the result will

[sqlalchemy] Querying specific class using String name of class

2011-08-22 Thread JPLaverdure
Hello, Is there a proper way to retrieve a class using its name other than going through the _decl_class_registry dictionary of declarative_base ? I'm using the Joined Table Inheritance and would like to enable users to query specific subtypes. ie: if I have the following structure: Base =