Fixed #13428 -- Corrected the allow_relation behavior of and example router. Thanks to jcd for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13133 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
e34ca2b1e2
commit
6b1a2a8e44
|
@ -256,7 +256,7 @@ master/slave relationship between the databases ``master``, ``slave1`` and
|
||||||
def allow_relation(self, obj1, obj2, **hints):
|
def allow_relation(self, obj1, obj2, **hints):
|
||||||
"Allow any relation between two objects in the db pool"
|
"Allow any relation between two objects in the db pool"
|
||||||
db_list = ('master','slave1','slave2')
|
db_list = ('master','slave1','slave2')
|
||||||
if obj1 in db_list and obj2 in db_list:
|
if obj1._state.db in db_list and obj2._state.db in db_list:
|
||||||
return True
|
return True
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue