Kaydet (Commit) 6b1a2a8e authored tarafından Russell Keith-Magee's avatar Russell Keith-Magee

Fixed #13428 -- Corrected the allow_relation behavior of and example router.…

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
üst e34ca2b1
......@@ -256,7 +256,7 @@ master/slave relationship between the databases ``master``, ``slave1`` and
def allow_relation(self, obj1, obj2, **hints):
"Allow any relation between two objects in the db pool"
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 None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment