Re: [sqlalchemy] defining foreign keys?

2011-10-26 Thread Stefano Fontanelli
Hi James, you cannot define two mapper properties that use the same name. Your User model specifies: addresses = relationship('Address', order_by='Address.id', backref='user') Your Address model specifies: user = relationship('User', backref=backref('addresses', order_by=id)) in the User

Re: [sqlalchemy] defining foreign keys?

2011-10-26 Thread Michael Bayer
On Oct 26, 2011, at 1:04 PM, James Hartley wrote: On Wed, Oct 26, 2011 at 2:22 AM, Stefano Fontanelli s.fontane...@asidev.com wrote: Hi James, you cannot define two mapper properties that use the same name. Thank you. I truly appreciate your response. I can now implement the table

Re: [sqlalchemy] defining foreign keys?

2011-10-26 Thread James Hartley
On Wed, Oct 26, 2011 at 10:15 AM, Michael Bayer mike...@zzzcomputing.comwrote: On Oct 26, 2011, at 1:04 PM, James Hartley wrote: On Wed, Oct 26, 2011 at 2:22 AM, Stefano Fontanelli s.fontane...@asidev.com wrote: Hi James, you cannot define two mapper properties that use the same name.

[sqlalchemy] defining foreign keys?

2011-10-25 Thread James Hartley
I suspect this is user error, but I am not ferreting out my mistake. I'm porting some older code to SQLAlchemy 0.71 on top of Python 2.7.1. Code which had originally implemented foreign keys without using REFERENCES clauses in CREATE TABLE statements previously ran fine. Now, adding formal