Re: [sqlalchemy] defining foreign keys?

2011-10-26 Thread James Hartley
On Wed, Oct 26, 2011 at 10:15 AM, Michael Bayer wrote: > > 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. >> > If you

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 > 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 > interconnection

Re: [sqlalchemy] defining foreign keys?

2011-10-26 Thread James Hartley
On Wed, Oct 26, 2011 at 2:22 AM, Stefano Fontanelli 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 interconnection while both classes are defined in the same file. My problem i

Re: [sqlalchemy] relationship trouble

2011-10-26 Thread Michael Bayer
On Oct 26, 2011, at 12:10 PM, Jakob L. wrote: > 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 (

[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 t

[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 = Field(String

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 model