[sqlalchemy] Attaching application-specific data to a model

2012-03-24 Thread Thibaut D.
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

[sqlalchemy] Re: Getting the mapped class from a property?

2012-03-24 Thread Torsten Irländer
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

Re: [sqlalchemy] SqlSoup - Error in relate

2012-03-24 Thread temo
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')

Re: [sqlalchemy] SqlSoup - Error in relate

2012-03-24 Thread Michael Bayer
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.