The mapper for the base class has a property called polymorphic_map which is a dictionary whose keys are the discriminator values and whose values are the mappers of the associated classes (you can get from there to the actual class via the mapper's class_ property).
I can't speak to whether this technique is API stable. On Fri, Jun 6, 2008 at 11:43 AM, Rick Morrison <[EMAIL PROTECTED]> wrote: > Is there an API-stable way to create a polymorphic instance from only the > type discriminator key? I've got a case where I need to create a mapped > instance from some JSON data that contains the type discriminator, but I'd > rather get the (key --> mapped class) from the sqla map and not maintain my > own, which may fall out of sync as the data model changes over time. > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---