hey Barry -
that would be a bug, and I cant reproduce it, at least the bug i think youre describing, in neither 0.3 nor 0.4:
from sqlalchemy import *
from sqlalchemy.orm import *
engine = create_engine('sqlite://')
meta = MetaData(engine)
a = Table('a', meta, Column('id', Integer, primary_key=True))
b = Table('b', meta, Column('id', Integer, primary_key=True), Column('a_id', Integer, ForeignKey('
a.id')))
c = Table('c', meta, Column('id', Integer, primary_key=True), Column('a_id', Integer, ForeignKey('
a.id')))
class A(object):pass
class B(object):pass
class C(object):pass
mapper(A, a)
mapper(B, b, properties={
'a':relation(A, backref='thebackref')
})
mapper(C, c, properties={
'a':relation(A, backref='thebackref')
})
compile_mappers()
output:
<stack trace>
sqlalchemy.exceptions.ArgumentError: Backrefs do not match: backref 'thebackref' expects to connect to <class '__main__.C'>, but found a backref already connected to <class '__main__.B'>
can you produce a test case ?