Skip to content
This repository
tree: cbbd7ad9d9
Fetching contributors…

Cannot retrieve contributors at this time

file 17 lines (13 sloc) 0.582 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
from django.conf import settings

USLOGGING_DATABASE = getattr(settings, 'USLOGGING_DATABASE', None)

class UnisubsRouter(object):
    def db_for_write(self, model, **hints):
        if model._meta.app_label in ['sentry', 'uslogging'] :
            return USLOGGING_DATABASE

    def db_for_read(self, model, **hints):
        return self.db_for_write(model, **hints)

    def allow_syncdb(self, db, model):
        if not USLOGGING_DATABASE:
            return None
        if model._meta.app_label in ['sentry', 'uslogging'] and db != USLOGGING_DATABASE:
            return False
Something went wrong with that request. Please try again.