Python version: 3.2.3
sqlalchemy version: 0.7.9

(Please see the attached source file.) I have a class Simple, which has two
subclasses - MixedFirst and MixedSecond. These two subclasses have a field
in common, namely, mixed. So I have put it in a separate class (a mixin)
named Mixin, which both MixedFirst and MixedSecond inherit from. I am using
single table inheritance to map this to database.

I am adding one instance each of Simple, MixedFirst and MixedSecond twice.
Once in add_rows(), and once in run_stuff().

When I query the table and polymorphically load all the instances, the
"mixed" field on some objects contains a value of type sqlalchemy Column,
which is incorrect. Here are some more specific observations:
- The rows added in run_stuff() work as expected (even if you comment out
the inserts in add_rows).
- The rows added in add_rows() show up the error of ".mixed" ending up
showing the wrong value (that of a SA column instead of the field value).
- If we reorder the declaration of MixedFirst and MixedSecond, the error of
".mixed" switches over to the instance of the class that gets declared
later.

I also tried using declared_attr as suggested here -
http://docs.sqlalchemy.org/ru/latest/orm/extensions/declarative.html, but
that made no difference.

This looks like a bug but I would first like to confirm it before filing a
bug report.

-- 
Cheers,
Rahul.

-- 
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 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Attachment: resetdb.py
Description: Binary data

Reply via email to