Skip to content

Commit

Permalink
Updated fixtures installation to support south.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenmcd committed Dec 5, 2010
1 parent 05b0105 commit 52fa3f7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cartridge/shop/management/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ def create_initial_product(app, created_models, verbosity, **kwargs):
call_command("loaddata", "cartridge.json")


post_syncdb.connect(create_initial_product, sender=shop_app)
if "south" not in settings.INSTALLED_APPS:
post_syncdb.connect(create_initial_product, sender=shop_app)
4 changes: 4 additions & 0 deletions cartridge/shop/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ def forwards(self, orm):
))
db.create_unique('shop_discountcode_categories', ['discountcode_id', 'category_id'])

from cartridge.shop.management import create_initial_product
from cartridge.shop.models import Product
from atexit import register
register(create_initial_product, None, (Product,), 1, interactive=True)

def backwards(self, orm):

Expand Down

0 comments on commit 52fa3f7

Please sign in to comment.