Gabriel Detraz
bba144ef14
Ce fix corrige le problème des opérations d'écritures dans la bdd master remote, qui marchaient mal, désormais les lignes de logs historiques sont correctement écrites. Il semblerait que django avait du mal à savoir que ces opérations reversion sont bien des opérations d'écriture.
28 lines
752 B
Django/Jinja
28 lines
752 B
Django/Jinja
class DbRouter(object):
|
|
"""
|
|
A router to control all database operations on models in the
|
|
auth application.
|
|
"""
|
|
def db_for_read(self, model, **hints):
|
|
"""
|
|
Attempts to read remote models go to local database.
|
|
"""
|
|
return 'local'
|
|
|
|
def db_for_write(self, model, **hints):
|
|
"""
|
|
Attempts to write remote models go to the remote database.
|
|
"""
|
|
return 'default'
|
|
|
|
def allow_relation(self, obj1, obj2, **hints):
|
|
"""
|
|
Allow relations involving the remote database
|
|
"""
|
|
return True
|
|
|
|
def allow_migrate(self, db, app_label, model_name=None, **hints):
|
|
"""
|
|
Allow migrations on the remote database
|
|
"""
|
|
return True
|