Hello, everyone. I can't find anythin on the we regarding this
subject, here's a snippet of my code:

friendship = Table(
    'friendships', Base.metadata,
    Column('friend_a_id', Integer, ForeignKey('users.id'),
primary_key=True),
    Column('friend_b_id', Integer, ForeignKey('users.id'),
primary_key=True)
    )

class User(Base):
    __tablename__ = 'users'

    id = Column(Integer, primary_key=True)

    friends = relationship('User',
                           secondary=friendship,
                           primaryjoin=id==friendship.c.friend_a_id,
                           secondaryjoin=id==friendship.c.friend_b_id,
                           )

Like I said in the subject, this backref (or back_populate) the
friends attribute on the other end of the relationship as well. So far
every example I've seen backrefs to a differently named attribute,
which can be accomplished with backref='any_name_other_than_this_one'.
But I actually want backref='friends'.

Have you any ideas?

Thanks a lot in advance, this has me pulling my hair off.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to