diff options
| author | Loic Bistuer <loic.bistuer@gmail.com> | 2015-01-09 00:10:10 +0700 |
|---|---|---|
| committer | Loic Bistuer <loic.bistuer@gmail.com> | 2015-01-10 00:30:48 +0700 |
| commit | 8f4877c89d0f28e289399fbb46357623a49e7eb0 (patch) | |
| tree | 928a44b6cdef3f685f80f350af554e1252e9b136 /django/db/utils.py | |
| parent | 665e0aa6ec80a48492033a3b2b4ffdfaae3c78eb (diff) | |
Fixed #22583 -- Allowed RunPython and RunSQL to provide hints to the db router.
Thanks Markus Holtermann and Tim Graham for the review.
Diffstat (limited to 'django/db/utils.py')
| -rw-r--r-- | django/db/utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/utils.py b/django/db/utils.py index a355bbe466..fc2203ff47 100644 --- a/django/db/utils.py +++ b/django/db/utils.py @@ -316,7 +316,7 @@ class ConnectionRouter(object): return allow return obj1._state.db == obj2._state.db - def allow_migrate(self, db, model): + def allow_migrate(self, db, model, **hints): for router in self.routers: try: try: @@ -331,7 +331,7 @@ class ConnectionRouter(object): # If the router doesn't have a method, skip to the next one. pass else: - allow = method(db, model) + allow = method(db, model, **hints) if allow is not None: return allow return True |
