Greetings,

Hope you are well. In my example I have two objects 'HttpTest' and
'SmtpTest' that both inherit from their super-class called 'Test'.

Due to the nature of the relationship, 'Test' will never actually be
stored in the database so I've not mapped that. However, a mixture of
'HttpTest' and 'SmtpTest' objects are both to be stored in the
hosttest_table, thus I created a mapping for them like this:

  httptest_mapper = mapper(HttpTest, hosttest_table, \
              polymorphic_on=hosttest_table.c.type,
polymorphic_identity='http')
  smtptest_mapper = mapper(SmtpTest, hosttest_table, \
              polymorphic_on=hosttest_table.c.type,
polymorphic_identity='smtp')

Unfortunately when I do, I get this error message:

  No such polymorphic_identity 'smtp' is defined

I was hoping SQLA would understand this and let me pack the two
objects into the same table, but for some reason it doesn't like it.

If someone could please give me some pointers on how to proceed, it
would be greatly appreciated. Thank you in advance for your time and
consideration.

Kind regards,
moggie.

--

You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.


Reply via email to