Hi,
I would like to know what's the recommended way to store application
specific data into my models (defined using declarative).
At model level ?
At column level ?
Thanks for your answer,
--
You received this message because you are subscribed to the Google Groups
sqlalchemy group.
To
Thank you Benjamin for your answer. I will test this after the
weekend.
Torsten
On 23 Mrz., 21:57, Benjamin Trofatter bentrofat...@gmail.com wrote:
I don't know if this is the canonical way of doing things, but you can
accomplish what you're asking with the following:
from sqlalchemy.orm
no, i'm on postgresql, the tables was generated django with syncdb,
i see the example, and change relate() to this:
self.db.catalog_unit.relate('catalog_product', self.db.catalog_product,
primaryjoin=catalog_product.id==catalog_unit.unit_purchase_id,
cascade='all, delete-orphan')
Yeah this is really not an easy use case with SQLSoup, you can't use the string
form and really if your database has FOREIGN KEY on unit_purchase_id you
shouldn't need to be doing this anyway - you'd want to check in your PGAdmin
tool to see if there is in fact an FK constraint on this column.