Created
August 12, 2013 15:50
-
-
Save nickpresta/6212132 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyRouter(object): | |
def db_for_read(self, model, **hints): | |
if model._meta.object_name == 'SpecialModel': | |
return 'special' | |
return False | |
def db_for_write(self, model, **hints): | |
return self.db_for_read(model, **hints) | |
def allow_syncdb(self, db, model): | |
if model._meta.app_label in ['south']: | |
return True | |
if db == 'special': | |
return model._meta.object_name == 'SpecialModel' | |
return False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment