[sqlalchemy] Re: Querying specific class using String name of class

2011-08-23 Thread Mike Gilligan
`eval` should work. Something like this: session.query(eval('DNA')).all() On Aug 22, 12:08 pm, JPLaverdure jp.laverd...@gmail.com wrote: 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

[sqlalchemy] Re: Querying specific class using String name of class

2011-08-23 Thread JPLaverdure
Hi Mike, Thanks for the reply. I'm just not sure that using `eval` represents a cleaner way than my original code... The Class query options are specified by the end user through a select (html form) so using eval poses a security risk I would like to avoid. I was hoping slqalchemy would