Skip to content

Instantly share code, notes, and snippets.

@nickpresta
Created August 12, 2013 15:50
Show Gist options
  • Save nickpresta/6212132 to your computer and use it in GitHub Desktop.
Save nickpresta/6212132 to your computer and use it in GitHub Desktop.
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