Created
May 3, 2012 22:58
-
-
Save cooncesean/2590191 to your computer and use it in GitHub Desktop.
Fix Your Dev Categories on Mom.me
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
# 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