Skip to content

Instantly share code, notes, and snippets.

@gregnewman
Created November 7, 2012 23:55
Show Gist options
  • Save gregnewman/4035476 to your computer and use it in GitHub Desktop.
Save gregnewman/4035476 to your computer and use it in GitHub Desktop.
from django.contrib.contenttypes.models import ContentType
def run():
def do(Table):
if Table is not None:
table_objects = Table.objects.all()
for i in table_objects:
i.save(using='slave')
ContentType.objects.using('slave').all().delete()
for i in ContentType.objects.all():
do(i.model_class())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment