From: Thomas Fillon Date: Fri, 28 Aug 2015 19:38:56 +0000 (+0200) Subject: Recreate models for records_shop app X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=1640009c639cb77109eabc48f6d5c071277f5ddd;p=diggersdigest.git Recreate models for records_shop app --- diff --git a/diggersdigest/records/script_data_recover.py b/diggersdigest/records/script_data_recover.py index 4881314..2825e08 100644 --- a/diggersdigest/records/script_data_recover.py +++ b/diggersdigest/records/script_data_recover.py @@ -199,7 +199,7 @@ for grade in rec_models.Grading.objects.all(): for option in settings.SHOP_OPTION_TYPE_CHOICES: option_obj, option_created = ProductOption.objects.get_or_create(type=option[0], name=grade.nom) - + print "%d fiches GradingCondition crées" % count diff --git a/diggersdigest/records_shop/admin.py b/diggersdigest/records_shop/admin.py index c581eb1..5b32f4a 100644 --- a/diggersdigest/records_shop/admin.py +++ b/diggersdigest/records_shop/admin.py @@ -1,6 +1,6 @@ from django.contrib import admin # Register your models here. -## from .models import RecordProduct +from .models import RecordProduct -## admin.site.register(RecordProduct) +admin.site.register(RecordProduct) diff --git a/diggersdigest/records_shop/migrations/0001_initial.py b/diggersdigest/records_shop/migrations/0001_initial.py new file mode 100644 index 0000000..b35c028 --- /dev/null +++ b/diggersdigest/records_shop/migrations/0001_initial.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('records', '0001_initial'), + ('shop', '0001_initial'), + ] + + operations = [ + migrations.CreateModel( + name='RecordProduct', + fields=[ + ('product_ptr', models.OneToOneField(parent_link=True, auto_created=True, primary_key=True, serialize=False, to='shop.Product')), + ('record', models.ForeignKey(related_name='record', verbose_name='record', to='records.Record')), + ], + options={ + 'abstract': False, + }, + bases=('shop.product',), + ), + ] diff --git a/diggersdigest/records_shop/migrations/__init__.py b/diggersdigest/records_shop/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/diggersdigest/records_shop/models.py b/diggersdigest/records_shop/models.py index c8f8d1f..e0ef9e5 100644 --- a/diggersdigest/records_shop/models.py +++ b/diggersdigest/records_shop/models.py @@ -6,7 +6,7 @@ from django.utils.translation import ugettext_lazy as _ from cartridge.shop.models import Product, ProductVariation -## from records.models import Record +from records.models import Record -## class RecordProduct(Product): -## record = models.ForeignKey(Record, verbose_name=_('record'), related_name='record') +class RecordProduct(Product): + record = models.ForeignKey(Record, verbose_name=_('record'), related_name='record')