mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2025-01-20 11:30:11 +00:00
增加数据库路由
This commit is contained in:
parent
07349ba6e2
commit
b4f45a619f
@ -18,13 +18,6 @@ class DBRouter(object):
|
|||||||
def allow_migrate(self, db, app_label, model=None, **hints):
|
def allow_migrate(self, db, app_label, model=None, **hints):
|
||||||
if app_label == "submission":
|
if app_label == "submission":
|
||||||
if db == "submission":
|
if db == "submission":
|
||||||
r = True
|
return db == app_label
|
||||||
else:
|
|
||||||
r = False
|
|
||||||
else:
|
else:
|
||||||
if db == "default":
|
return db == "default"
|
||||||
r = True
|
|
||||||
else:
|
|
||||||
r = False
|
|
||||||
print db, app_label, r
|
|
||||||
return r
|
|
Loading…
x
Reference in New Issue
Block a user