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

[sqlalchemy] relationship trouble

2011-10-26 Thread Jakob L.
Hi! I added a new self-referential relationship to one of my tables but since I couldn't find how to create the new column through SA I added it to the db manually after checking how it's been done before. The code looks like this (using elixir): class User(Entity): username =

[sqlalchemy] Re: relationship trouble

2011-10-26 Thread Jakob L.
Sorry, I named the new field parent_username and the index ix_user_parent_username -- You received this message because you are subscribed to the Google Groups sqlalchemy group. To view this discussion on the web visit https://groups.google.com/d/msg/sqlalchemy/-/pPpCbKKCWnAJ. To post to

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.