* Add primaryjoin information where SQLAlchemy can become confused as to

which foreign key is used for a relation.
This commit is contained in:
Toshio Kuratomi 2008-02-19 12:35:55 -08:00
parent 8c8b2f723a
commit 5ac6e4b83e

View file

@ -192,7 +192,8 @@ mapper(PersonEmails, PersonEmailsTable, properties = {
PersonEmailsTable.c.purpose))
})
mapper(PersonRoles, PersonRolesTable, properties = {
'member': relation(People, backref = 'roles'),
'member': relation(People, backref = 'roles',
primaryjoin=PersonRolesTable.c.person_id==PeopleTable.c.id),
'group': relation(Groups, backref='roles')
})
mapper(Configs, ConfigsTable, properties = {
@ -214,7 +215,8 @@ mapper(GroupRoles, GroupRolesTable, properties = {
})
mapper(BugzillaQueue, BugzillaQueueTable, properties = {
'group': relation(Groups, backref = 'pending'),
'person': relation(People, backref = 'pending')
'person': relation(People, backref = 'pending',
primaryjoin=BugzillaQueueTable.c.person_id==PeopleTable.c.id)
})
# TurboGears Identity