On 10/12/2010 01:16 PM, Branko Vukelic wrote:
> Hi, list,
>
> Given all models used the declarative syntax (and I assume they are
> now all somehow known to the base), and given a class name in string
> form, can I somehow retrieve the actual class?
>
> Regards,
>
>
The information is available in the declarative base class, via the
_decl_class_registry attribute:
Base = declarative_base()
class MappedClass(Base):
__tablename__ = "mapped_class"
id = Column(Integer, primary_key=True)
assert Base._decl_class_registry["MappedClass"] is MappedClass
-Conor
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected].
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.