Re: [sqlalchemy] SqlSoup - Error in relate

2012-03-26 Thread temo
with the sqlalchemy tables it works, but i dont like solution :P, now i have to map all tables :/ thanks for your time :) El sábado 24 de marzo de 2012 23:49:15 UTC-6, Michael Bayer escribió: Yeah this is really not an easy use case with SQLSoup, you can't use the string form and really if

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.

[sqlalchemy] SqlSoup - Error in relate

2012-03-23 Thread temo
Hi Im mapping a database with sqlsoup and when use db.relate shows this error: sqlalchemy.exc.ArgumentError: Could not determine join condition between parent/child tables on relationship MappedCatalog_unit.catalog_product. Specify a 'primaryjoin' expression. If 'secondary' is present,

Re: [sqlalchemy] SqlSoup - Error in relate

2012-03-23 Thread Michael Bayer
you'd need to specify join conditions as they occur in an example like this one: http://docs.sqlalchemy.org/en/latest/orm/relationships.html#setting-the-primaryjoin-and-secondaryjoin relate() should accept the same arguments as relationship(). the source of the issue is probably that you're on