Hello, everyone!
Here is an example of generic relation with association_proxy:
http://docs.sqlalchemy.org/en/rel_1_1/_modules/examples/generic_associations/discriminator_on_association.html
It works great, but I've found one issue. If you add to the end of the
code something like that:
session.add(Address(
street='123 anywhere street',
city="New York",
zip="10110",
parent=Customer(name='customer 1')
))
It won't work. What I've done here is that instead of assigning Address
instance to a Customer instance, I reversed it. And it throws an error.
I would appreciate any input on that.
--
With kind regards, Andrew Pashkin.
cell phone - +375 (44) 492-16-85
Skype - waves_in_fluids
e-mail - [email protected]
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example. See http://stackoverflow.com/help/mcve for a full description.
---
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 https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.