thanks Mike! i didn't remember inspect ...
best regards,
richard.
On 01/14/2014 01:49 PM, Michael Bayer wrote:
you should be able to use inspect(cls).polymorphic_identity
http://docs.sqlalchemy.org/en/rel_0_9/orm/mapper_config.html?highlight=polymorphic_identity#sqlalchemy.orm.mapper.Mapper.polymorphic_identity
On Jan 14, 2014, at 8:55 AM, Richard Gerd Kuesters
<[email protected] <mailto:[email protected]>> wrote:
what's the best way to check and retrieve the polymorphic identity of
a mapped class?
I'm using:
*pi = cls.__mapper_args__.get('polymorphic_identity')**
**if pi:**
** # rest of the code**
** ...*
I'm just wondering if there's a shortcut or a better way to achieve
this, since I'm not fond of using *__variables__* :)
best regards,
richard.
--
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]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.
--
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/groups/opt_out.