Re: [sqlalchemy] column_property on a related table with substring

2010-12-03 Thread Nagy Viktor
sorry, you were right, I've had a different bug in my code On Thu, Dec 2, 2010 at 5:19 PM, Michael Bayer mike...@zzzcomputing.comwrote: On Dec 2, 2010, at 10:07 AM, Nagy Viktor wrote: I've tried what you proposed, but it still doesn't work: my code is now: production_request =

[sqlalchemy] column_property on a related table with substring

2010-12-02 Thread Nagy Viktor
hi, I would like to represent an existing database and its associations in sqlalchemy. Unfortunately, it has many flows, like two tables are related via a substring from one table. something like this class ParentClass: id = ... type = ... class ChildClass: nr_proforma = Column('',

Re: [sqlalchemy] column_property on a related table with substring

2010-12-02 Thread Michael Bayer
On Dec 2, 2010, at 5:53 AM, Nagy Viktor wrote: hi, I would like to represent an existing database and its associations in sqlalchemy. Unfortunately, it has many flows, like two tables are related via a substring from one table. something like this class ParentClass: id = ...

Re: [sqlalchemy] column_property on a related table with substring

2010-12-02 Thread Nagy Viktor
I've tried what you proposed, but it still doesn't work: my code is now: production_request = column_property( select([ProductionRequests.id])\ .where(ProductionRequests.id==cast(func.substring(nr_proforma, 3), Integer))\ .where(ProductionRequests.type==type),

Re: [sqlalchemy] column_property on a related table with substring

2010-12-02 Thread Michael Bayer
On Dec 2, 2010, at 10:07 AM, Nagy Viktor wrote: I've tried what you proposed, but it still doesn't work: my code is now: production_request = column_property( select([ProductionRequests.id])\ .where(ProductionRequests.id==cast(func.substring(nr_proforma, 3),