Skip to content

Instantly share code, notes, and snippets.

@cooncesean
Created May 3, 2012 22:58
Show Gist options
  • Save cooncesean/2590191 to your computer and use it in GitHub Desktop.
Save cooncesean/2590191 to your computer and use it in GitHub Desktop.
Fix Your Dev Categories on Mom.me
# STEP 1 #############################
# Delete all Categories
from ella.core.models import Category
Category.objects.all().delete()
# close this shell
# STEP 2 #############################
# OPEN momme/site/__init__.py and comment out the last line:
# post_save.connect(forum_category_syncer, sender=Category)
# STEP 3 #############################
# Load the category_data.json fixture
> python manage.py loaddata category_json
# STEP 4 #############################
# OPEN momme/site/__init__.py and UNcomment out the line we commented out earlier:
# post_save.connect(forum_category_syncer, sender=Category)
# STEP 4 #############################
# Save all Categories
for c in Category.objects.all():
print c
c.save()
# You should be all goodz!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment