Bläddra i källkod

Links form order app to voucher/offer broken.

This is probably a breaking change for most people as the migration
history for the order app has been rewritten.  It will take some
fiddling around with south to get your system back in order.

This change is required though as we need to break the links between the
apps.
master
David Winterbottom 13 år sedan
förälder
incheckning
4bc8104ec6

+ 3
- 2
oscar/apps/offer/receivers.py Visa fil

23
     if discount.voucher:
23
     if discount.voucher:
24
         discount.voucher.total_discount += discount.amount
24
         discount.voucher.total_discount += discount.amount
25
         discount.voucher.save()
25
         discount.voucher.save()
26
-    discount.offer.total_discount += discount.amount
27
-    discount.offer.save()
26
+    if discount.offer:
27
+        discount.offer.total_discount += discount.amount
28
+        discount.offer.save()
28
     
29
     
29
     
30
     
30
         
31
         

+ 19
- 3
oscar/apps/order/abstract_models.py Visa fil

22
     number = models.CharField(_("Order number"), max_length=128, db_index=True)
22
     number = models.CharField(_("Order number"), max_length=128, db_index=True)
23
     # We track the site that each order is placed within
23
     # We track the site that each order is placed within
24
     site = models.ForeignKey('sites.Site')
24
     site = models.ForeignKey('sites.Site')
25
-    basket = models.ForeignKey('basket.Basket', null=True, blank=True)
25
+    basket_id = models.PositiveIntegerField(null=True, blank=True)
26
     # Orders can be anonymous so we don't always have a customer ID
26
     # Orders can be anonymous so we don't always have a customer ID
27
     user = models.ForeignKey(User, related_name='orders', null=True, blank=True)
27
     user = models.ForeignKey(User, related_name='orders', null=True, blank=True)
28
     # Billing address is not always required (eg paying by gift card)
28
     # Billing address is not always required (eg paying by gift card)
599
     separately even though in reality, the discounts are applied at the line level.
599
     separately even though in reality, the discounts are applied at the line level.
600
     """
600
     """
601
     order = models.ForeignKey('order.Order', related_name="discounts")
601
     order = models.ForeignKey('order.Order', related_name="discounts")
602
-    offer = models.ForeignKey('offer.ConditionalOffer', null=True, on_delete=models.SET_NULL)
603
-    voucher = models.ForeignKey('voucher.Voucher', related_name="discount_vouchers", null=True, on_delete=models.SET_NULL)
602
+    offer_id = models.PositiveIntegerField(blank=True, null=True)
603
+    voucher_id = models.PositiveIntegerField(blank=True, null=True)
604
     voucher_code = models.CharField(_("Code"), max_length=128, db_index=True, null=True)
604
     voucher_code = models.CharField(_("Code"), max_length=128, db_index=True, null=True)
605
     amount = models.DecimalField(decimal_places=2, max_digits=12, default=0)
605
     amount = models.DecimalField(decimal_places=2, max_digits=12, default=0)
606
     
606
     
609
         
609
         
610
     def __unicode__(self):
610
     def __unicode__(self):
611
         return u"Discount of %r from order %s" % (self.amount, self.order)    
611
         return u"Discount of %r from order %s" % (self.amount, self.order)    
612
+
613
+    @property
614
+    def offer(self):
615
+        Offer = models.get_model('offer', 'ConditionalOffer')
616
+        try:
617
+            return Offer.objects.get(id=self.offer_id)
618
+        except Offer.DoesNotExist:
619
+            return None
620
+
621
+    @property
622
+    def voucher(self):
623
+        Voucher = models.get_model('voucher', 'Voucher')
624
+        try:
625
+            return Voucher.objects.get(id=self.offer_id)
626
+        except Voucher.DoesNotExist:
627
+            return None
612
         
628
         
613
     def description(self):
629
     def description(self):
614
         if self.voucher_code:
630
         if self.voucher_code:

+ 25
- 84
oscar/apps/order/migrations/0001_initial.py Visa fil

31
             ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
31
             ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
32
             ('number', self.gf('django.db.models.fields.CharField')(max_length=128, db_index=True)),
32
             ('number', self.gf('django.db.models.fields.CharField')(max_length=128, db_index=True)),
33
             ('site', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['sites.Site'])),
33
             ('site', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['sites.Site'])),
34
-            ('basket', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['basket.Basket'], null=True, blank=True)),
34
+            ('basket_id', self.gf('django.db.models.fields.PositiveIntegerField')(null=True, blank=True)),
35
             ('user', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='orders', null=True, to=orm['auth.User'])),
35
             ('user', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='orders', null=True, to=orm['auth.User'])),
36
             ('billing_address', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['order.BillingAddress'], null=True, blank=True)),
36
             ('billing_address', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['order.BillingAddress'], null=True, blank=True)),
37
             ('total_incl_tax', self.gf('django.db.models.fields.DecimalField')(max_digits=12, decimal_places=2)),
37
             ('total_incl_tax', self.gf('django.db.models.fields.DecimalField')(max_digits=12, decimal_places=2)),
60
         db.create_table('order_communicationevent', (
60
         db.create_table('order_communicationevent', (
61
             ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
61
             ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
62
             ('order', self.gf('django.db.models.fields.related.ForeignKey')(related_name='communication_events', to=orm['order.Order'])),
62
             ('order', self.gf('django.db.models.fields.related.ForeignKey')(related_name='communication_events', to=orm['order.Order'])),
63
-            ('type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['customer.CommunicationEventType'])),
63
+            ('event_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['customer.CommunicationEventType'])),
64
             ('date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
64
             ('date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
65
         ))
65
         ))
66
         db.send_create_signal('order', ['CommunicationEvent'])
66
         db.send_create_signal('order', ['CommunicationEvent'])
162
         # Adding model 'ShippingEventType'
162
         # Adding model 'ShippingEventType'
163
         db.create_table('order_shippingeventtype', (
163
         db.create_table('order_shippingeventtype', (
164
             ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
164
             ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
165
-            ('name', self.gf('django.db.models.fields.CharField')(max_length=255)),
166
-            ('code', self.gf('django.db.models.fields.SlugField')(max_length=128, db_index=True)),
165
+            ('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=255)),
166
+            ('code', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=128, db_index=True)),
167
             ('is_required', self.gf('django.db.models.fields.BooleanField')(default=True)),
167
             ('is_required', self.gf('django.db.models.fields.BooleanField')(default=True)),
168
             ('sequence_number', self.gf('django.db.models.fields.PositiveIntegerField')(default=0)),
168
             ('sequence_number', self.gf('django.db.models.fields.PositiveIntegerField')(default=0)),
169
         ))
169
         ))
173
         db.create_table('order_paymentevent', (
173
         db.create_table('order_paymentevent', (
174
             ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
174
             ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
175
             ('order', self.gf('django.db.models.fields.related.ForeignKey')(related_name='payment_events', to=orm['order.Order'])),
175
             ('order', self.gf('django.db.models.fields.related.ForeignKey')(related_name='payment_events', to=orm['order.Order'])),
176
+            ('amount', self.gf('django.db.models.fields.DecimalField')(max_digits=12, decimal_places=2)),
176
             ('event_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['order.PaymentEventType'])),
177
             ('event_type', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['order.PaymentEventType'])),
177
             ('date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
178
             ('date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
178
         ))
179
         ))
181
         # Adding model 'PaymentEventType'
182
         # Adding model 'PaymentEventType'
182
         db.create_table('order_paymenteventtype', (
183
         db.create_table('order_paymenteventtype', (
183
             ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
184
             ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
184
-            ('name', self.gf('django.db.models.fields.CharField')(max_length=128)),
185
-            ('code', self.gf('django.db.models.fields.SlugField')(max_length=128, db_index=True)),
185
+            ('name', self.gf('django.db.models.fields.CharField')(unique=True, max_length=128)),
186
+            ('code', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=128, db_index=True)),
186
             ('sequence_number', self.gf('django.db.models.fields.PositiveIntegerField')(default=0)),
187
             ('sequence_number', self.gf('django.db.models.fields.PositiveIntegerField')(default=0)),
187
         ))
188
         ))
188
         db.send_create_signal('order', ['PaymentEventType'])
189
         db.send_create_signal('order', ['PaymentEventType'])
191
         db.create_table('order_orderdiscount', (
192
         db.create_table('order_orderdiscount', (
192
             ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
193
             ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
193
             ('order', self.gf('django.db.models.fields.related.ForeignKey')(related_name='discounts', to=orm['order.Order'])),
194
             ('order', self.gf('django.db.models.fields.related.ForeignKey')(related_name='discounts', to=orm['order.Order'])),
194
-            ('offer', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['offer.ConditionalOffer'], null=True)),
195
-            ('voucher', self.gf('django.db.models.fields.related.ForeignKey')(related_name='discount_vouchers', null=True, to=orm['voucher.Voucher'])),
195
+            ('offer_id', self.gf('django.db.models.fields.PositiveIntegerField')(null=True, blank=True)),
196
+            ('voucher_id', self.gf('django.db.models.fields.PositiveIntegerField')(null=True, blank=True)),
196
             ('voucher_code', self.gf('django.db.models.fields.CharField')(max_length=128, null=True, db_index=True)),
197
             ('voucher_code', self.gf('django.db.models.fields.CharField')(max_length=128, null=True, db_index=True)),
197
             ('amount', self.gf('django.db.models.fields.DecimalField')(default=0, max_digits=12, decimal_places=2)),
198
             ('amount', self.gf('django.db.models.fields.DecimalField')(default=0, max_digits=12, decimal_places=2)),
198
         ))
199
         ))
287
             'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
288
             'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
288
             'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
289
             'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
289
         },
290
         },
290
-        'basket.basket': {
291
-            'Meta': {'object_name': 'Basket'},
292
-            'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
293
-            'date_merged': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
294
-            'date_submitted': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
295
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
296
-            'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'baskets'", 'null': 'True', 'to': "orm['auth.User']"}),
297
-            'status': ('django.db.models.fields.CharField', [], {'default': "'Open'", 'max_length': '128'}),
298
-            'vouchers': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['voucher.Voucher']", 'null': 'True', 'symmetrical': 'False'})
299
-        },
300
         'catalogue.attributeentity': {
291
         'catalogue.attributeentity': {
301
             'Meta': {'object_name': 'AttributeEntity'},
292
             'Meta': {'object_name': 'AttributeEntity'},
302
             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
293
             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
324
         'catalogue.category': {
315
         'catalogue.category': {
325
             'Meta': {'ordering': "['name']", 'object_name': 'Category'},
316
             'Meta': {'ordering': "['name']", 'object_name': 'Category'},
326
             'depth': ('django.db.models.fields.PositiveIntegerField', [], {}),
317
             'depth': ('django.db.models.fields.PositiveIntegerField', [], {}),
318
+            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
327
             'full_name': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'db_index': 'True'}),
319
             'full_name': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'db_index': 'True'}),
328
             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
320
             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
321
+            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
329
             'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),
322
             'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),
330
             'numchild': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
323
             'numchild': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
331
             'path': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
324
             'path': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
353
             'related_products': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'relations'", 'blank': 'True', 'to': "orm['catalogue.Product']"}),
346
             'related_products': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'relations'", 'blank': 'True', 'to': "orm['catalogue.Product']"}),
354
             'score': ('django.db.models.fields.FloatField', [], {'default': '0.0', 'db_index': 'True'}),
347
             'score': ('django.db.models.fields.FloatField', [], {'default': '0.0', 'db_index': 'True'}),
355
             'slug': ('django.db.models.fields.SlugField', [], {'max_length': '255', 'db_index': 'True'}),
348
             'slug': ('django.db.models.fields.SlugField', [], {'max_length': '255', 'db_index': 'True'}),
349
+            'status': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '128', 'null': 'True', 'blank': 'True'}),
356
             'title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
350
             'title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
357
-            'upc': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '64', 'null': 'True', 'blank': 'True'})
351
+            'upc': ('django.db.models.fields.CharField', [], {'max_length': '64', 'unique': 'True', 'null': 'True', 'blank': 'True'})
358
         },
352
         },
359
         'catalogue.productattribute': {
353
         'catalogue.productattribute': {
360
             'Meta': {'ordering': "['code']", 'object_name': 'ProductAttribute'},
354
             'Meta': {'ordering': "['code']", 'object_name': 'ProductAttribute'},
371
             'Meta': {'object_name': 'ProductAttributeValue'},
365
             'Meta': {'object_name': 'ProductAttributeValue'},
372
             'attribute': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.ProductAttribute']"}),
366
             'attribute': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.ProductAttribute']"}),
373
             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
367
             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
374
-            'product': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Product']"}),
368
+            'product': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'attribute_values'", 'to': "orm['catalogue.Product']"}),
375
             'value_boolean': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
369
             'value_boolean': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
376
             'value_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
370
             'value_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
377
             'value_entity': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.AttributeEntity']", 'null': 'True', 'blank': 'True'}),
371
             'value_entity': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.AttributeEntity']", 'null': 'True', 'blank': 'True'}),
422
             'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
416
             'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
423
             'sms_template': ('django.db.models.fields.CharField', [], {'max_length': '170', 'blank': 'True'})
417
             'sms_template': ('django.db.models.fields.CharField', [], {'max_length': '170', 'blank': 'True'})
424
         },
418
         },
425
-        'offer.benefit': {
426
-            'Meta': {'object_name': 'Benefit'},
427
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
428
-            'max_affected_items': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
429
-            'range': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['offer.Range']", 'null': 'True', 'blank': 'True'}),
430
-            'type': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
431
-            'value': ('oscar.models.fields.PositiveDecimalField', [], {'null': 'True', 'max_digits': '12', 'decimal_places': '2', 'blank': 'True'})
432
-        },
433
-        'offer.condition': {
434
-            'Meta': {'object_name': 'Condition'},
435
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
436
-            'range': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['offer.Range']"}),
437
-            'type': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
438
-            'value': ('oscar.models.fields.PositiveDecimalField', [], {'max_digits': '12', 'decimal_places': '2'})
439
-        },
440
-        'offer.conditionaloffer': {
441
-            'Meta': {'ordering': "['-priority']", 'object_name': 'ConditionalOffer'},
442
-            'benefit': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['offer.Benefit']"}),
443
-            'condition': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['offer.Condition']"}),
444
-            'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
445
-            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
446
-            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
447
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
448
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
449
-            'offer_type': ('django.db.models.fields.CharField', [], {'default': "'Site'", 'max_length': '128'}),
450
-            'priority': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
451
-            'redirect_url': ('oscar.models.fields.ExtendedURLField', [], {'max_length': '200', 'blank': 'True'}),
452
-            'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
453
-            'total_discount': ('django.db.models.fields.DecimalField', [], {'default': "'0.00'", 'max_digits': '12', 'decimal_places': '2'})
454
-        },
455
-        'offer.range': {
456
-            'Meta': {'object_name': 'Range'},
457
-            'classes': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'classes'", 'blank': 'True', 'to': "orm['catalogue.ProductClass']"}),
458
-            'excluded_products': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'excludes'", 'blank': 'True', 'to': "orm['catalogue.Product']"}),
459
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
460
-            'included_categories': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'includes'", 'blank': 'True', 'to': "orm['catalogue.Category']"}),
461
-            'included_products': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'includes'", 'blank': 'True', 'to': "orm['catalogue.Product']"}),
462
-            'includes_all_products': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
463
-            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'})
464
-        },
465
         'order.billingaddress': {
419
         'order.billingaddress': {
466
             'Meta': {'object_name': 'BillingAddress'},
420
             'Meta': {'object_name': 'BillingAddress'},
467
             'country': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['address.Country']"}),
421
             'country': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['address.Country']"}),
480
         'order.communicationevent': {
434
         'order.communicationevent': {
481
             'Meta': {'object_name': 'CommunicationEvent'},
435
             'Meta': {'object_name': 'CommunicationEvent'},
482
             'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
436
             'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
437
+            'event_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['customer.CommunicationEventType']"}),
483
             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
438
             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
484
-            'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'communication_events'", 'to': "orm['order.Order']"}),
485
-            'type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['customer.CommunicationEventType']"})
439
+            'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'communication_events'", 'to': "orm['order.Order']"})
486
         },
440
         },
487
         'order.line': {
441
         'order.line': {
488
             'Meta': {'object_name': 'Line'},
442
             'Meta': {'object_name': 'Line'},
528
         },
482
         },
529
         'order.order': {
483
         'order.order': {
530
             'Meta': {'ordering': "['-date_placed']", 'object_name': 'Order'},
484
             'Meta': {'ordering': "['-date_placed']", 'object_name': 'Order'},
531
-            'basket': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['basket.Basket']", 'null': 'True', 'blank': 'True'}),
485
+            'basket_id': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
532
             'billing_address': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['order.BillingAddress']", 'null': 'True', 'blank': 'True'}),
486
             'billing_address': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['order.BillingAddress']", 'null': 'True', 'blank': 'True'}),
533
             'date_placed': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
487
             'date_placed': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
534
             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
488
             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
547
             'Meta': {'object_name': 'OrderDiscount'},
501
             'Meta': {'object_name': 'OrderDiscount'},
548
             'amount': ('django.db.models.fields.DecimalField', [], {'default': '0', 'max_digits': '12', 'decimal_places': '2'}),
502
             'amount': ('django.db.models.fields.DecimalField', [], {'default': '0', 'max_digits': '12', 'decimal_places': '2'}),
549
             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
503
             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
550
-            'offer': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['offer.ConditionalOffer']", 'null': 'True'}),
504
+            'offer_id': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
551
             'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'discounts'", 'to': "orm['order.Order']"}),
505
             'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'discounts'", 'to': "orm['order.Order']"}),
552
-            'voucher': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'discount_vouchers'", 'null': 'True', 'to': "orm['voucher.Voucher']"}),
553
-            'voucher_code': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'db_index': 'True'})
506
+            'voucher_code': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'db_index': 'True'}),
507
+            'voucher_id': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'})
554
         },
508
         },
555
         'order.ordernote': {
509
         'order.ordernote': {
556
             'Meta': {'object_name': 'OrderNote'},
510
             'Meta': {'object_name': 'OrderNote'},
563
         },
517
         },
564
         'order.paymentevent': {
518
         'order.paymentevent': {
565
             'Meta': {'object_name': 'PaymentEvent'},
519
             'Meta': {'object_name': 'PaymentEvent'},
520
+            'amount': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '2'}),
566
             'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
521
             'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
567
             'event_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['order.PaymentEventType']"}),
522
             'event_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['order.PaymentEventType']"}),
568
             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
523
             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
578
         },
533
         },
579
         'order.paymenteventtype': {
534
         'order.paymenteventtype': {
580
             'Meta': {'ordering': "('sequence_number',)", 'object_name': 'PaymentEventType'},
535
             'Meta': {'ordering': "('sequence_number',)", 'object_name': 'PaymentEventType'},
581
-            'code': ('django.db.models.fields.SlugField', [], {'max_length': '128', 'db_index': 'True'}),
536
+            'code': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}),
582
             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
537
             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
583
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
538
+            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}),
584
             'sequence_number': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'})
539
             'sequence_number': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'})
585
         },
540
         },
586
         'order.shippingaddress': {
541
         'order.shippingaddress': {
618
         },
573
         },
619
         'order.shippingeventtype': {
574
         'order.shippingeventtype': {
620
             'Meta': {'ordering': "('sequence_number',)", 'object_name': 'ShippingEventType'},
575
             'Meta': {'ordering': "('sequence_number',)", 'object_name': 'ShippingEventType'},
621
-            'code': ('django.db.models.fields.SlugField', [], {'max_length': '128', 'db_index': 'True'}),
576
+            'code': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}),
622
             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
577
             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
623
             'is_required': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
578
             'is_required': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
624
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
579
+            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
625
             'sequence_number': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'})
580
             'sequence_number': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'})
626
         },
581
         },
627
         'partner.partner': {
582
         'partner.partner': {
635
             'domain': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
590
             'domain': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
636
             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
591
             'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
637
             'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
592
             'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
638
-        },
639
-        'voucher.voucher': {
640
-            'Meta': {'object_name': 'Voucher'},
641
-            'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}),
642
-            'date_created': ('django.db.models.fields.DateField', [], {'auto_now_add': 'True', 'blank': 'True'}),
643
-            'end_date': ('django.db.models.fields.DateField', [], {}),
644
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
645
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
646
-            'num_basket_additions': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
647
-            'num_orders': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
648
-            'offers': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'vouchers'", 'symmetrical': 'False', 'to': "orm['offer.ConditionalOffer']"}),
649
-            'start_date': ('django.db.models.fields.DateField', [], {}),
650
-            'total_discount': ('django.db.models.fields.DecimalField', [], {'default': "'0.00'", 'max_digits': '12', 'decimal_places': '2'}),
651
-            'usage': ('django.db.models.fields.CharField', [], {'default': "'Multi-use'", 'max_length': '128'})
652
         }
593
         }
653
     }
594
     }
654
 
595
 

+ 0
- 435
oscar/apps/order/migrations/0002_auto__del_field_communicationevent_type__add_field_communicationevent_.py Visa fil

1
-# encoding: utf-8
2
-import datetime
3
-from south.db import db
4
-from south.v2 import SchemaMigration
5
-from django.db import models
6
-
7
-class Migration(SchemaMigration):
8
-
9
-    def forwards(self, orm):
10
-        
11
-        # Deleting field 'CommunicationEvent.type'
12
-        db.delete_column('order_communicationevent', 'type_id')
13
-
14
-        # Adding field 'CommunicationEvent.event_type'
15
-        db.add_column('order_communicationevent', 'event_type', self.gf('django.db.models.fields.related.ForeignKey')(default=1, to=orm['customer.CommunicationEventType']), keep_default=False)
16
-
17
-
18
-    def backwards(self, orm):
19
-        
20
-        # User chose to not deal with backwards NULL issues for 'CommunicationEvent.type'
21
-        raise RuntimeError("Cannot reverse this migration. 'CommunicationEvent.type' and its values cannot be restored.")
22
-
23
-        # Deleting field 'CommunicationEvent.event_type'
24
-        db.delete_column('order_communicationevent', 'event_type_id')
25
-
26
-
27
-    models = {
28
-        'address.country': {
29
-            'Meta': {'ordering': "('-is_highlighted', 'name')", 'object_name': 'Country'},
30
-            'is_highlighted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
31
-            'is_shipping_country': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
32
-            'iso_3166_1_a2': ('django.db.models.fields.CharField', [], {'max_length': '2', 'primary_key': 'True'}),
33
-            'iso_3166_1_a3': ('django.db.models.fields.CharField', [], {'max_length': '3', 'null': 'True', 'db_index': 'True'}),
34
-            'iso_3166_1_numeric': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'db_index': 'True'}),
35
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
36
-            'printable_name': ('django.db.models.fields.CharField', [], {'max_length': '128'})
37
-        },
38
-        'auth.group': {
39
-            'Meta': {'object_name': 'Group'},
40
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
41
-            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
42
-            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
43
-        },
44
-        'auth.permission': {
45
-            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
46
-            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
47
-            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
48
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
49
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
50
-        },
51
-        'auth.user': {
52
-            'Meta': {'object_name': 'User'},
53
-            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
54
-            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
55
-            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
56
-            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
57
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
58
-            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
59
-            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
60
-            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
61
-            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
62
-            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
63
-            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
64
-            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
65
-            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
66
-        },
67
-        'basket.basket': {
68
-            'Meta': {'object_name': 'Basket'},
69
-            'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
70
-            'date_merged': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
71
-            'date_submitted': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
72
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
73
-            'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'baskets'", 'null': 'True', 'to': "orm['auth.User']"}),
74
-            'status': ('django.db.models.fields.CharField', [], {'default': "'Open'", 'max_length': '128'}),
75
-            'vouchers': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['voucher.Voucher']", 'null': 'True', 'symmetrical': 'False'})
76
-        },
77
-        'catalogue.attributeentity': {
78
-            'Meta': {'object_name': 'AttributeEntity'},
79
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
80
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
81
-            'slug': ('django.db.models.fields.SlugField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}),
82
-            'type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'entities'", 'to': "orm['catalogue.AttributeEntityType']"})
83
-        },
84
-        'catalogue.attributeentitytype': {
85
-            'Meta': {'object_name': 'AttributeEntityType'},
86
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
87
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
88
-            'slug': ('django.db.models.fields.SlugField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'})
89
-        },
90
-        'catalogue.attributeoption': {
91
-            'Meta': {'object_name': 'AttributeOption'},
92
-            'group': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'options'", 'to': "orm['catalogue.AttributeOptionGroup']"}),
93
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
94
-            'option': ('django.db.models.fields.CharField', [], {'max_length': '255'})
95
-        },
96
-        'catalogue.attributeoptiongroup': {
97
-            'Meta': {'object_name': 'AttributeOptionGroup'},
98
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
99
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'})
100
-        },
101
-        'catalogue.category': {
102
-            'Meta': {'ordering': "['name']", 'object_name': 'Category'},
103
-            'depth': ('django.db.models.fields.PositiveIntegerField', [], {}),
104
-            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
105
-            'full_name': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'db_index': 'True'}),
106
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
107
-            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
108
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),
109
-            'numchild': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
110
-            'path': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
111
-            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '1024', 'db_index': 'True'})
112
-        },
113
-        'catalogue.option': {
114
-            'Meta': {'object_name': 'Option'},
115
-            'code': ('django.db.models.fields.SlugField', [], {'max_length': '128', 'db_index': 'True'}),
116
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
117
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
118
-            'type': ('django.db.models.fields.CharField', [], {'default': "'Required'", 'max_length': '128'})
119
-        },
120
-        'catalogue.product': {
121
-            'Meta': {'ordering': "['-date_created']", 'object_name': 'Product'},
122
-            'attributes': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.ProductAttribute']", 'through': "orm['catalogue.ProductAttributeValue']", 'symmetrical': 'False'}),
123
-            'categories': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.Category']", 'through': "orm['catalogue.ProductCategory']", 'symmetrical': 'False'}),
124
-            'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
125
-            'date_updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
126
-            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
127
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
128
-            'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'variants'", 'null': 'True', 'to': "orm['catalogue.Product']"}),
129
-            'product_class': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.ProductClass']", 'null': 'True'}),
130
-            'product_options': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.Option']", 'symmetrical': 'False', 'blank': 'True'}),
131
-            'recommended_products': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.Product']", 'symmetrical': 'False', 'through': "orm['catalogue.ProductRecommendation']", 'blank': 'True'}),
132
-            'related_products': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'relations'", 'blank': 'True', 'to': "orm['catalogue.Product']"}),
133
-            'score': ('django.db.models.fields.FloatField', [], {'default': '0.0', 'db_index': 'True'}),
134
-            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '255', 'db_index': 'True'}),
135
-            'status': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '128', 'null': 'True', 'blank': 'True'}),
136
-            'title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
137
-            'upc': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '64', 'null': 'True', 'blank': 'True'})
138
-        },
139
-        'catalogue.productattribute': {
140
-            'Meta': {'ordering': "['code']", 'object_name': 'ProductAttribute'},
141
-            'code': ('django.db.models.fields.SlugField', [], {'max_length': '128', 'db_index': 'True'}),
142
-            'entity_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.AttributeEntityType']", 'null': 'True', 'blank': 'True'}),
143
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
144
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
145
-            'option_group': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.AttributeOptionGroup']", 'null': 'True', 'blank': 'True'}),
146
-            'product_class': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'attributes'", 'null': 'True', 'to': "orm['catalogue.ProductClass']"}),
147
-            'required': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
148
-            'type': ('django.db.models.fields.CharField', [], {'default': "'text'", 'max_length': '20'})
149
-        },
150
-        'catalogue.productattributevalue': {
151
-            'Meta': {'object_name': 'ProductAttributeValue'},
152
-            'attribute': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.ProductAttribute']"}),
153
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
154
-            'product': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'attribute_values'", 'to': "orm['catalogue.Product']"}),
155
-            'value_boolean': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
156
-            'value_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
157
-            'value_entity': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.AttributeEntity']", 'null': 'True', 'blank': 'True'}),
158
-            'value_float': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
159
-            'value_integer': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
160
-            'value_option': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.AttributeOption']", 'null': 'True', 'blank': 'True'}),
161
-            'value_richtext': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
162
-            'value_text': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'})
163
-        },
164
-        'catalogue.productcategory': {
165
-            'Meta': {'ordering': "['-is_canonical']", 'object_name': 'ProductCategory'},
166
-            'category': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Category']"}),
167
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
168
-            'is_canonical': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
169
-            'product': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Product']"})
170
-        },
171
-        'catalogue.productclass': {
172
-            'Meta': {'ordering': "['name']", 'object_name': 'ProductClass'},
173
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
174
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
175
-            'options': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.Option']", 'symmetrical': 'False', 'blank': 'True'}),
176
-            'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'})
177
-        },
178
-        'catalogue.productrecommendation': {
179
-            'Meta': {'object_name': 'ProductRecommendation'},
180
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
181
-            'primary': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'primary_recommendations'", 'to': "orm['catalogue.Product']"}),
182
-            'ranking': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0'}),
183
-            'recommendation': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Product']"})
184
-        },
185
-        'contenttypes.contenttype': {
186
-            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
187
-            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
188
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
189
-            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
190
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
191
-        },
192
-        'customer.communicationeventtype': {
193
-            'Meta': {'object_name': 'CommunicationEventType'},
194
-            'category': ('django.db.models.fields.CharField', [], {'default': "'Order related'", 'max_length': '255'}),
195
-            'code': ('django.db.models.fields.SlugField', [], {'max_length': '128', 'db_index': 'True'}),
196
-            'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
197
-            'date_updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
198
-            'email_body_html_template': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
199
-            'email_body_template': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
200
-            'email_subject_template': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
201
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
202
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
203
-            'sms_template': ('django.db.models.fields.CharField', [], {'max_length': '170', 'blank': 'True'})
204
-        },
205
-        'offer.benefit': {
206
-            'Meta': {'object_name': 'Benefit'},
207
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
208
-            'max_affected_items': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
209
-            'range': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['offer.Range']", 'null': 'True', 'blank': 'True'}),
210
-            'type': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
211
-            'value': ('oscar.models.fields.PositiveDecimalField', [], {'null': 'True', 'max_digits': '12', 'decimal_places': '2', 'blank': 'True'})
212
-        },
213
-        'offer.condition': {
214
-            'Meta': {'object_name': 'Condition'},
215
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
216
-            'range': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['offer.Range']"}),
217
-            'type': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
218
-            'value': ('oscar.models.fields.PositiveDecimalField', [], {'max_digits': '12', 'decimal_places': '2'})
219
-        },
220
-        'offer.conditionaloffer': {
221
-            'Meta': {'ordering': "['-priority']", 'object_name': 'ConditionalOffer'},
222
-            'benefit': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['offer.Benefit']"}),
223
-            'condition': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['offer.Condition']"}),
224
-            'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
225
-            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
226
-            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
227
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
228
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
229
-            'offer_type': ('django.db.models.fields.CharField', [], {'default': "'Site'", 'max_length': '128'}),
230
-            'priority': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
231
-            'redirect_url': ('oscar.models.fields.ExtendedURLField', [], {'max_length': '200', 'blank': 'True'}),
232
-            'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
233
-            'total_discount': ('django.db.models.fields.DecimalField', [], {'default': "'0.00'", 'max_digits': '12', 'decimal_places': '2'})
234
-        },
235
-        'offer.range': {
236
-            'Meta': {'object_name': 'Range'},
237
-            'classes': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'classes'", 'blank': 'True', 'to': "orm['catalogue.ProductClass']"}),
238
-            'excluded_products': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'excludes'", 'blank': 'True', 'to': "orm['catalogue.Product']"}),
239
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
240
-            'included_categories': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'includes'", 'blank': 'True', 'to': "orm['catalogue.Category']"}),
241
-            'included_products': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'includes'", 'blank': 'True', 'to': "orm['catalogue.Product']"}),
242
-            'includes_all_products': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
243
-            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'})
244
-        },
245
-        'order.billingaddress': {
246
-            'Meta': {'object_name': 'BillingAddress'},
247
-            'country': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['address.Country']"}),
248
-            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
249
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
250
-            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
251
-            'line1': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
252
-            'line2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
253
-            'line3': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
254
-            'line4': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
255
-            'postcode': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
256
-            'search_text': ('django.db.models.fields.CharField', [], {'max_length': '1000'}),
257
-            'state': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
258
-            'title': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'})
259
-        },
260
-        'order.communicationevent': {
261
-            'Meta': {'object_name': 'CommunicationEvent'},
262
-            'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
263
-            'event_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['customer.CommunicationEventType']"}),
264
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
265
-            'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'communication_events'", 'to': "orm['order.Order']"})
266
-        },
267
-        'order.line': {
268
-            'Meta': {'object_name': 'Line'},
269
-            'est_dispatch_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
270
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
271
-            'line_price_before_discounts_excl_tax': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '2'}),
272
-            'line_price_before_discounts_incl_tax': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '2'}),
273
-            'line_price_excl_tax': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '2'}),
274
-            'line_price_incl_tax': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '2'}),
275
-            'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'lines'", 'to': "orm['order.Order']"}),
276
-            'partner': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'order_lines'", 'null': 'True', 'to': "orm['partner.Partner']"}),
277
-            'partner_line_notes': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
278
-            'partner_line_reference': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
279
-            'partner_name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
280
-            'partner_sku': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
281
-            'product': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Product']", 'null': 'True', 'blank': 'True'}),
282
-            'quantity': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}),
283
-            'status': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
284
-            'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
285
-            'unit_cost_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '12', 'decimal_places': '2', 'blank': 'True'}),
286
-            'unit_price_excl_tax': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '12', 'decimal_places': '2', 'blank': 'True'}),
287
-            'unit_price_incl_tax': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '12', 'decimal_places': '2', 'blank': 'True'}),
288
-            'unit_retail_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '12', 'decimal_places': '2', 'blank': 'True'})
289
-        },
290
-        'order.lineattribute': {
291
-            'Meta': {'object_name': 'LineAttribute'},
292
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
293
-            'line': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'attributes'", 'to': "orm['order.Line']"}),
294
-            'option': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'line_attributes'", 'null': 'True', 'to': "orm['catalogue.Option']"}),
295
-            'type': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
296
-            'value': ('django.db.models.fields.CharField', [], {'max_length': '255'})
297
-        },
298
-        'order.lineprice': {
299
-            'Meta': {'object_name': 'LinePrice'},
300
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
301
-            'line': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'prices'", 'to': "orm['order.Line']"}),
302
-            'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'line_prices'", 'to': "orm['order.Order']"}),
303
-            'price_excl_tax': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '2'}),
304
-            'price_incl_tax': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '2'}),
305
-            'quantity': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}),
306
-            'shipping_excl_tax': ('django.db.models.fields.DecimalField', [], {'default': '0', 'max_digits': '12', 'decimal_places': '2'}),
307
-            'shipping_incl_tax': ('django.db.models.fields.DecimalField', [], {'default': '0', 'max_digits': '12', 'decimal_places': '2'})
308
-        },
309
-        'order.order': {
310
-            'Meta': {'ordering': "['-date_placed']", 'object_name': 'Order'},
311
-            'basket': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['basket.Basket']", 'null': 'True', 'blank': 'True'}),
312
-            'billing_address': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['order.BillingAddress']", 'null': 'True', 'blank': 'True'}),
313
-            'date_placed': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
314
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
315
-            'number': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}),
316
-            'shipping_address': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['order.ShippingAddress']", 'null': 'True', 'blank': 'True'}),
317
-            'shipping_excl_tax': ('django.db.models.fields.DecimalField', [], {'default': '0', 'max_digits': '12', 'decimal_places': '2'}),
318
-            'shipping_incl_tax': ('django.db.models.fields.DecimalField', [], {'default': '0', 'max_digits': '12', 'decimal_places': '2'}),
319
-            'shipping_method': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
320
-            'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}),
321
-            'status': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
322
-            'total_excl_tax': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '2'}),
323
-            'total_incl_tax': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '2'}),
324
-            'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'orders'", 'null': 'True', 'to': "orm['auth.User']"})
325
-        },
326
-        'order.orderdiscount': {
327
-            'Meta': {'object_name': 'OrderDiscount'},
328
-            'amount': ('django.db.models.fields.DecimalField', [], {'default': '0', 'max_digits': '12', 'decimal_places': '2'}),
329
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
330
-            'offer': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['offer.ConditionalOffer']", 'null': 'True'}),
331
-            'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'discounts'", 'to': "orm['order.Order']"}),
332
-            'voucher': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'discount_vouchers'", 'null': 'True', 'to': "orm['voucher.Voucher']"}),
333
-            'voucher_code': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'db_index': 'True'})
334
-        },
335
-        'order.ordernote': {
336
-            'Meta': {'object_name': 'OrderNote'},
337
-            'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
338
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
339
-            'message': ('django.db.models.fields.TextField', [], {}),
340
-            'note_type': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}),
341
-            'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'notes'", 'to': "orm['order.Order']"}),
342
-            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'})
343
-        },
344
-        'order.paymentevent': {
345
-            'Meta': {'object_name': 'PaymentEvent'},
346
-            'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
347
-            'event_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['order.PaymentEventType']"}),
348
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
349
-            'lines': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['order.Line']", 'through': "orm['order.PaymentEventQuantity']", 'symmetrical': 'False'}),
350
-            'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'payment_events'", 'to': "orm['order.Order']"})
351
-        },
352
-        'order.paymenteventquantity': {
353
-            'Meta': {'object_name': 'PaymentEventQuantity'},
354
-            'event': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'line_quantities'", 'to': "orm['order.PaymentEvent']"}),
355
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
356
-            'line': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['order.Line']"}),
357
-            'quantity': ('django.db.models.fields.PositiveIntegerField', [], {})
358
-        },
359
-        'order.paymenteventtype': {
360
-            'Meta': {'ordering': "('sequence_number',)", 'object_name': 'PaymentEventType'},
361
-            'code': ('django.db.models.fields.SlugField', [], {'max_length': '128', 'db_index': 'True'}),
362
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
363
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
364
-            'sequence_number': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'})
365
-        },
366
-        'order.shippingaddress': {
367
-            'Meta': {'object_name': 'ShippingAddress'},
368
-            'country': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['address.Country']"}),
369
-            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
370
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
371
-            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
372
-            'line1': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
373
-            'line2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
374
-            'line3': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
375
-            'line4': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
376
-            'notes': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
377
-            'phone_number': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
378
-            'postcode': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
379
-            'search_text': ('django.db.models.fields.CharField', [], {'max_length': '1000'}),
380
-            'state': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
381
-            'title': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'})
382
-        },
383
-        'order.shippingevent': {
384
-            'Meta': {'ordering': "['-date']", 'object_name': 'ShippingEvent'},
385
-            'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
386
-            'event_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['order.ShippingEventType']"}),
387
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
388
-            'lines': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['order.Line']", 'through': "orm['order.ShippingEventQuantity']", 'symmetrical': 'False'}),
389
-            'notes': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
390
-            'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'shipping_events'", 'to': "orm['order.Order']"})
391
-        },
392
-        'order.shippingeventquantity': {
393
-            'Meta': {'object_name': 'ShippingEventQuantity'},
394
-            'event': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'line_quantities'", 'to': "orm['order.ShippingEvent']"}),
395
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
396
-            'line': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['order.Line']"}),
397
-            'quantity': ('django.db.models.fields.PositiveIntegerField', [], {})
398
-        },
399
-        'order.shippingeventtype': {
400
-            'Meta': {'ordering': "('sequence_number',)", 'object_name': 'ShippingEventType'},
401
-            'code': ('django.db.models.fields.SlugField', [], {'max_length': '128', 'db_index': 'True'}),
402
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
403
-            'is_required': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
404
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
405
-            'sequence_number': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'})
406
-        },
407
-        'partner.partner': {
408
-            'Meta': {'object_name': 'Partner'},
409
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
410
-            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}),
411
-            'users': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'partners'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['auth.User']"})
412
-        },
413
-        'sites.site': {
414
-            'Meta': {'ordering': "('domain',)", 'object_name': 'Site', 'db_table': "'django_site'"},
415
-            'domain': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
416
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
417
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
418
-        },
419
-        'voucher.voucher': {
420
-            'Meta': {'object_name': 'Voucher'},
421
-            'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}),
422
-            'date_created': ('django.db.models.fields.DateField', [], {'auto_now_add': 'True', 'blank': 'True'}),
423
-            'end_date': ('django.db.models.fields.DateField', [], {}),
424
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
425
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
426
-            'num_basket_additions': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
427
-            'num_orders': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
428
-            'offers': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'vouchers'", 'symmetrical': 'False', 'to': "orm['offer.ConditionalOffer']"}),
429
-            'start_date': ('django.db.models.fields.DateField', [], {}),
430
-            'total_discount': ('django.db.models.fields.DecimalField', [], {'default': "'0.00'", 'max_digits': '12', 'decimal_places': '2'}),
431
-            'usage': ('django.db.models.fields.CharField', [], {'default': "'Multi-use'", 'max_length': '128'})
432
-        }
433
-    }
434
-
435
-    complete_apps = ['order']

+ 0
- 447
oscar/apps/order/migrations/0003_auto__add_unique_shippingeventtype_code__add_unique_shippingeventtype_.py Visa fil

1
-# encoding: utf-8
2
-import datetime
3
-from south.db import db
4
-from south.v2 import SchemaMigration
5
-from django.db import models
6
-
7
-class Migration(SchemaMigration):
8
-
9
-    def forwards(self, orm):
10
-        
11
-        # Adding unique constraint on 'ShippingEventType', fields ['code']
12
-        db.create_unique('order_shippingeventtype', ['code'])
13
-
14
-        # Adding unique constraint on 'ShippingEventType', fields ['name']
15
-        db.create_unique('order_shippingeventtype', ['name'])
16
-
17
-        # Adding unique constraint on 'PaymentEventType', fields ['code']
18
-        db.create_unique('order_paymenteventtype', ['code'])
19
-
20
-        # Adding unique constraint on 'PaymentEventType', fields ['name']
21
-        db.create_unique('order_paymenteventtype', ['name'])
22
-
23
-
24
-    def backwards(self, orm):
25
-        
26
-        # Removing unique constraint on 'PaymentEventType', fields ['name']
27
-        db.delete_unique('order_paymenteventtype', ['name'])
28
-
29
-        # Removing unique constraint on 'PaymentEventType', fields ['code']
30
-        db.delete_unique('order_paymenteventtype', ['code'])
31
-
32
-        # Removing unique constraint on 'ShippingEventType', fields ['name']
33
-        db.delete_unique('order_shippingeventtype', ['name'])
34
-
35
-        # Removing unique constraint on 'ShippingEventType', fields ['code']
36
-        db.delete_unique('order_shippingeventtype', ['code'])
37
-
38
-
39
-    models = {
40
-        'address.country': {
41
-            'Meta': {'ordering': "('-is_highlighted', 'name')", 'object_name': 'Country'},
42
-            'is_highlighted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
43
-            'is_shipping_country': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
44
-            'iso_3166_1_a2': ('django.db.models.fields.CharField', [], {'max_length': '2', 'primary_key': 'True'}),
45
-            'iso_3166_1_a3': ('django.db.models.fields.CharField', [], {'max_length': '3', 'null': 'True', 'db_index': 'True'}),
46
-            'iso_3166_1_numeric': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'db_index': 'True'}),
47
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
48
-            'printable_name': ('django.db.models.fields.CharField', [], {'max_length': '128'})
49
-        },
50
-        'auth.group': {
51
-            'Meta': {'object_name': 'Group'},
52
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
53
-            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
54
-            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
55
-        },
56
-        'auth.permission': {
57
-            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
58
-            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
59
-            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
60
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
61
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
62
-        },
63
-        'auth.user': {
64
-            'Meta': {'object_name': 'User'},
65
-            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
66
-            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
67
-            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
68
-            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
69
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
70
-            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
71
-            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
72
-            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
73
-            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
74
-            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
75
-            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
76
-            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
77
-            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
78
-        },
79
-        'basket.basket': {
80
-            'Meta': {'object_name': 'Basket'},
81
-            'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
82
-            'date_merged': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
83
-            'date_submitted': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
84
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
85
-            'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'baskets'", 'null': 'True', 'to': "orm['auth.User']"}),
86
-            'status': ('django.db.models.fields.CharField', [], {'default': "'Open'", 'max_length': '128'}),
87
-            'vouchers': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['voucher.Voucher']", 'null': 'True', 'symmetrical': 'False'})
88
-        },
89
-        'catalogue.attributeentity': {
90
-            'Meta': {'object_name': 'AttributeEntity'},
91
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
92
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
93
-            'slug': ('django.db.models.fields.SlugField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}),
94
-            'type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'entities'", 'to': "orm['catalogue.AttributeEntityType']"})
95
-        },
96
-        'catalogue.attributeentitytype': {
97
-            'Meta': {'object_name': 'AttributeEntityType'},
98
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
99
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
100
-            'slug': ('django.db.models.fields.SlugField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'})
101
-        },
102
-        'catalogue.attributeoption': {
103
-            'Meta': {'object_name': 'AttributeOption'},
104
-            'group': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'options'", 'to': "orm['catalogue.AttributeOptionGroup']"}),
105
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
106
-            'option': ('django.db.models.fields.CharField', [], {'max_length': '255'})
107
-        },
108
-        'catalogue.attributeoptiongroup': {
109
-            'Meta': {'object_name': 'AttributeOptionGroup'},
110
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
111
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'})
112
-        },
113
-        'catalogue.category': {
114
-            'Meta': {'ordering': "['name']", 'object_name': 'Category'},
115
-            'depth': ('django.db.models.fields.PositiveIntegerField', [], {}),
116
-            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
117
-            'full_name': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'db_index': 'True'}),
118
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
119
-            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
120
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),
121
-            'numchild': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
122
-            'path': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
123
-            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '1024', 'db_index': 'True'})
124
-        },
125
-        'catalogue.option': {
126
-            'Meta': {'object_name': 'Option'},
127
-            'code': ('django.db.models.fields.SlugField', [], {'max_length': '128', 'db_index': 'True'}),
128
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
129
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
130
-            'type': ('django.db.models.fields.CharField', [], {'default': "'Required'", 'max_length': '128'})
131
-        },
132
-        'catalogue.product': {
133
-            'Meta': {'ordering': "['-date_created']", 'object_name': 'Product'},
134
-            'attributes': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.ProductAttribute']", 'through': "orm['catalogue.ProductAttributeValue']", 'symmetrical': 'False'}),
135
-            'categories': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.Category']", 'through': "orm['catalogue.ProductCategory']", 'symmetrical': 'False'}),
136
-            'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
137
-            'date_updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
138
-            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
139
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
140
-            'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'variants'", 'null': 'True', 'to': "orm['catalogue.Product']"}),
141
-            'product_class': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.ProductClass']", 'null': 'True'}),
142
-            'product_options': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.Option']", 'symmetrical': 'False', 'blank': 'True'}),
143
-            'recommended_products': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.Product']", 'symmetrical': 'False', 'through': "orm['catalogue.ProductRecommendation']", 'blank': 'True'}),
144
-            'related_products': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'relations'", 'blank': 'True', 'to': "orm['catalogue.Product']"}),
145
-            'score': ('django.db.models.fields.FloatField', [], {'default': '0.0', 'db_index': 'True'}),
146
-            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '255', 'db_index': 'True'}),
147
-            'status': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '128', 'null': 'True', 'blank': 'True'}),
148
-            'title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
149
-            'upc': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '64', 'null': 'True', 'blank': 'True'})
150
-        },
151
-        'catalogue.productattribute': {
152
-            'Meta': {'ordering': "['code']", 'object_name': 'ProductAttribute'},
153
-            'code': ('django.db.models.fields.SlugField', [], {'max_length': '128', 'db_index': 'True'}),
154
-            'entity_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.AttributeEntityType']", 'null': 'True', 'blank': 'True'}),
155
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
156
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
157
-            'option_group': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.AttributeOptionGroup']", 'null': 'True', 'blank': 'True'}),
158
-            'product_class': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'attributes'", 'null': 'True', 'to': "orm['catalogue.ProductClass']"}),
159
-            'required': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
160
-            'type': ('django.db.models.fields.CharField', [], {'default': "'text'", 'max_length': '20'})
161
-        },
162
-        'catalogue.productattributevalue': {
163
-            'Meta': {'object_name': 'ProductAttributeValue'},
164
-            'attribute': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.ProductAttribute']"}),
165
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
166
-            'product': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'attribute_values'", 'to': "orm['catalogue.Product']"}),
167
-            'value_boolean': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
168
-            'value_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
169
-            'value_entity': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.AttributeEntity']", 'null': 'True', 'blank': 'True'}),
170
-            'value_float': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
171
-            'value_integer': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
172
-            'value_option': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.AttributeOption']", 'null': 'True', 'blank': 'True'}),
173
-            'value_richtext': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
174
-            'value_text': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'})
175
-        },
176
-        'catalogue.productcategory': {
177
-            'Meta': {'ordering': "['-is_canonical']", 'object_name': 'ProductCategory'},
178
-            'category': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Category']"}),
179
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
180
-            'is_canonical': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
181
-            'product': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Product']"})
182
-        },
183
-        'catalogue.productclass': {
184
-            'Meta': {'ordering': "['name']", 'object_name': 'ProductClass'},
185
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
186
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
187
-            'options': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.Option']", 'symmetrical': 'False', 'blank': 'True'}),
188
-            'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'})
189
-        },
190
-        'catalogue.productrecommendation': {
191
-            'Meta': {'object_name': 'ProductRecommendation'},
192
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
193
-            'primary': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'primary_recommendations'", 'to': "orm['catalogue.Product']"}),
194
-            'ranking': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0'}),
195
-            'recommendation': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Product']"})
196
-        },
197
-        'contenttypes.contenttype': {
198
-            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
199
-            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
200
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
201
-            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
202
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
203
-        },
204
-        'customer.communicationeventtype': {
205
-            'Meta': {'object_name': 'CommunicationEventType'},
206
-            'category': ('django.db.models.fields.CharField', [], {'default': "'Order related'", 'max_length': '255'}),
207
-            'code': ('django.db.models.fields.SlugField', [], {'max_length': '128', 'db_index': 'True'}),
208
-            'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
209
-            'date_updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
210
-            'email_body_html_template': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
211
-            'email_body_template': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
212
-            'email_subject_template': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
213
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
214
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
215
-            'sms_template': ('django.db.models.fields.CharField', [], {'max_length': '170', 'blank': 'True'})
216
-        },
217
-        'offer.benefit': {
218
-            'Meta': {'object_name': 'Benefit'},
219
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
220
-            'max_affected_items': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
221
-            'range': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['offer.Range']", 'null': 'True', 'blank': 'True'}),
222
-            'type': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
223
-            'value': ('oscar.models.fields.PositiveDecimalField', [], {'null': 'True', 'max_digits': '12', 'decimal_places': '2', 'blank': 'True'})
224
-        },
225
-        'offer.condition': {
226
-            'Meta': {'object_name': 'Condition'},
227
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
228
-            'range': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['offer.Range']"}),
229
-            'type': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
230
-            'value': ('oscar.models.fields.PositiveDecimalField', [], {'max_digits': '12', 'decimal_places': '2'})
231
-        },
232
-        'offer.conditionaloffer': {
233
-            'Meta': {'ordering': "['-priority']", 'object_name': 'ConditionalOffer'},
234
-            'benefit': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['offer.Benefit']"}),
235
-            'condition': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['offer.Condition']"}),
236
-            'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
237
-            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
238
-            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
239
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
240
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
241
-            'offer_type': ('django.db.models.fields.CharField', [], {'default': "'Site'", 'max_length': '128'}),
242
-            'priority': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
243
-            'redirect_url': ('oscar.models.fields.ExtendedURLField', [], {'max_length': '200', 'blank': 'True'}),
244
-            'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
245
-            'total_discount': ('django.db.models.fields.DecimalField', [], {'default': "'0.00'", 'max_digits': '12', 'decimal_places': '2'})
246
-        },
247
-        'offer.range': {
248
-            'Meta': {'object_name': 'Range'},
249
-            'classes': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'classes'", 'blank': 'True', 'to': "orm['catalogue.ProductClass']"}),
250
-            'excluded_products': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'excludes'", 'blank': 'True', 'to': "orm['catalogue.Product']"}),
251
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
252
-            'included_categories': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'includes'", 'blank': 'True', 'to': "orm['catalogue.Category']"}),
253
-            'included_products': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'includes'", 'blank': 'True', 'to': "orm['catalogue.Product']"}),
254
-            'includes_all_products': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
255
-            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'})
256
-        },
257
-        'order.billingaddress': {
258
-            'Meta': {'object_name': 'BillingAddress'},
259
-            'country': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['address.Country']"}),
260
-            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
261
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
262
-            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
263
-            'line1': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
264
-            'line2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
265
-            'line3': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
266
-            'line4': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
267
-            'postcode': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
268
-            'search_text': ('django.db.models.fields.CharField', [], {'max_length': '1000'}),
269
-            'state': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
270
-            'title': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'})
271
-        },
272
-        'order.communicationevent': {
273
-            'Meta': {'object_name': 'CommunicationEvent'},
274
-            'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
275
-            'event_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['customer.CommunicationEventType']"}),
276
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
277
-            'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'communication_events'", 'to': "orm['order.Order']"})
278
-        },
279
-        'order.line': {
280
-            'Meta': {'object_name': 'Line'},
281
-            'est_dispatch_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
282
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
283
-            'line_price_before_discounts_excl_tax': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '2'}),
284
-            'line_price_before_discounts_incl_tax': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '2'}),
285
-            'line_price_excl_tax': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '2'}),
286
-            'line_price_incl_tax': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '2'}),
287
-            'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'lines'", 'to': "orm['order.Order']"}),
288
-            'partner': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'order_lines'", 'null': 'True', 'to': "orm['partner.Partner']"}),
289
-            'partner_line_notes': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
290
-            'partner_line_reference': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
291
-            'partner_name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
292
-            'partner_sku': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
293
-            'product': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Product']", 'null': 'True', 'blank': 'True'}),
294
-            'quantity': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}),
295
-            'status': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
296
-            'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
297
-            'unit_cost_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '12', 'decimal_places': '2', 'blank': 'True'}),
298
-            'unit_price_excl_tax': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '12', 'decimal_places': '2', 'blank': 'True'}),
299
-            'unit_price_incl_tax': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '12', 'decimal_places': '2', 'blank': 'True'}),
300
-            'unit_retail_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '12', 'decimal_places': '2', 'blank': 'True'})
301
-        },
302
-        'order.lineattribute': {
303
-            'Meta': {'object_name': 'LineAttribute'},
304
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
305
-            'line': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'attributes'", 'to': "orm['order.Line']"}),
306
-            'option': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'line_attributes'", 'null': 'True', 'to': "orm['catalogue.Option']"}),
307
-            'type': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
308
-            'value': ('django.db.models.fields.CharField', [], {'max_length': '255'})
309
-        },
310
-        'order.lineprice': {
311
-            'Meta': {'object_name': 'LinePrice'},
312
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
313
-            'line': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'prices'", 'to': "orm['order.Line']"}),
314
-            'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'line_prices'", 'to': "orm['order.Order']"}),
315
-            'price_excl_tax': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '2'}),
316
-            'price_incl_tax': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '2'}),
317
-            'quantity': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}),
318
-            'shipping_excl_tax': ('django.db.models.fields.DecimalField', [], {'default': '0', 'max_digits': '12', 'decimal_places': '2'}),
319
-            'shipping_incl_tax': ('django.db.models.fields.DecimalField', [], {'default': '0', 'max_digits': '12', 'decimal_places': '2'})
320
-        },
321
-        'order.order': {
322
-            'Meta': {'ordering': "['-date_placed']", 'object_name': 'Order'},
323
-            'basket': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['basket.Basket']", 'null': 'True', 'blank': 'True'}),
324
-            'billing_address': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['order.BillingAddress']", 'null': 'True', 'blank': 'True'}),
325
-            'date_placed': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
326
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
327
-            'number': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}),
328
-            'shipping_address': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['order.ShippingAddress']", 'null': 'True', 'blank': 'True'}),
329
-            'shipping_excl_tax': ('django.db.models.fields.DecimalField', [], {'default': '0', 'max_digits': '12', 'decimal_places': '2'}),
330
-            'shipping_incl_tax': ('django.db.models.fields.DecimalField', [], {'default': '0', 'max_digits': '12', 'decimal_places': '2'}),
331
-            'shipping_method': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
332
-            'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}),
333
-            'status': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
334
-            'total_excl_tax': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '2'}),
335
-            'total_incl_tax': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '2'}),
336
-            'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'orders'", 'null': 'True', 'to': "orm['auth.User']"})
337
-        },
338
-        'order.orderdiscount': {
339
-            'Meta': {'object_name': 'OrderDiscount'},
340
-            'amount': ('django.db.models.fields.DecimalField', [], {'default': '0', 'max_digits': '12', 'decimal_places': '2'}),
341
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
342
-            'offer': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['offer.ConditionalOffer']", 'null': 'True'}),
343
-            'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'discounts'", 'to': "orm['order.Order']"}),
344
-            'voucher': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'discount_vouchers'", 'null': 'True', 'to': "orm['voucher.Voucher']"}),
345
-            'voucher_code': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'db_index': 'True'})
346
-        },
347
-        'order.ordernote': {
348
-            'Meta': {'object_name': 'OrderNote'},
349
-            'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
350
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
351
-            'message': ('django.db.models.fields.TextField', [], {}),
352
-            'note_type': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}),
353
-            'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'notes'", 'to': "orm['order.Order']"}),
354
-            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'})
355
-        },
356
-        'order.paymentevent': {
357
-            'Meta': {'object_name': 'PaymentEvent'},
358
-            'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
359
-            'event_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['order.PaymentEventType']"}),
360
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
361
-            'lines': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['order.Line']", 'through': "orm['order.PaymentEventQuantity']", 'symmetrical': 'False'}),
362
-            'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'payment_events'", 'to': "orm['order.Order']"})
363
-        },
364
-        'order.paymenteventquantity': {
365
-            'Meta': {'object_name': 'PaymentEventQuantity'},
366
-            'event': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'line_quantities'", 'to': "orm['order.PaymentEvent']"}),
367
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
368
-            'line': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['order.Line']"}),
369
-            'quantity': ('django.db.models.fields.PositiveIntegerField', [], {})
370
-        },
371
-        'order.paymenteventtype': {
372
-            'Meta': {'ordering': "('sequence_number',)", 'object_name': 'PaymentEventType'},
373
-            'code': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}),
374
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
375
-            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}),
376
-            'sequence_number': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'})
377
-        },
378
-        'order.shippingaddress': {
379
-            'Meta': {'object_name': 'ShippingAddress'},
380
-            'country': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['address.Country']"}),
381
-            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
382
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
383
-            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
384
-            'line1': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
385
-            'line2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
386
-            'line3': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
387
-            'line4': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
388
-            'notes': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
389
-            'phone_number': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
390
-            'postcode': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
391
-            'search_text': ('django.db.models.fields.CharField', [], {'max_length': '1000'}),
392
-            'state': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
393
-            'title': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'})
394
-        },
395
-        'order.shippingevent': {
396
-            'Meta': {'ordering': "['-date']", 'object_name': 'ShippingEvent'},
397
-            'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
398
-            'event_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['order.ShippingEventType']"}),
399
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
400
-            'lines': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['order.Line']", 'through': "orm['order.ShippingEventQuantity']", 'symmetrical': 'False'}),
401
-            'notes': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
402
-            'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'shipping_events'", 'to': "orm['order.Order']"})
403
-        },
404
-        'order.shippingeventquantity': {
405
-            'Meta': {'object_name': 'ShippingEventQuantity'},
406
-            'event': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'line_quantities'", 'to': "orm['order.ShippingEvent']"}),
407
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
408
-            'line': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['order.Line']"}),
409
-            'quantity': ('django.db.models.fields.PositiveIntegerField', [], {})
410
-        },
411
-        'order.shippingeventtype': {
412
-            'Meta': {'ordering': "('sequence_number',)", 'object_name': 'ShippingEventType'},
413
-            'code': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}),
414
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
415
-            'is_required': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
416
-            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
417
-            'sequence_number': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'})
418
-        },
419
-        'partner.partner': {
420
-            'Meta': {'object_name': 'Partner'},
421
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
422
-            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}),
423
-            'users': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'partners'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['auth.User']"})
424
-        },
425
-        'sites.site': {
426
-            'Meta': {'ordering': "('domain',)", 'object_name': 'Site', 'db_table': "'django_site'"},
427
-            'domain': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
428
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
429
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
430
-        },
431
-        'voucher.voucher': {
432
-            'Meta': {'object_name': 'Voucher'},
433
-            'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}),
434
-            'date_created': ('django.db.models.fields.DateField', [], {'auto_now_add': 'True', 'blank': 'True'}),
435
-            'end_date': ('django.db.models.fields.DateField', [], {}),
436
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
437
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
438
-            'num_basket_additions': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
439
-            'num_orders': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
440
-            'offers': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'vouchers'", 'symmetrical': 'False', 'to': "orm['offer.ConditionalOffer']"}),
441
-            'start_date': ('django.db.models.fields.DateField', [], {}),
442
-            'total_discount': ('django.db.models.fields.DecimalField', [], {'default': "'0.00'", 'max_digits': '12', 'decimal_places': '2'}),
443
-            'usage': ('django.db.models.fields.CharField', [], {'default': "'Multi-use'", 'max_length': '128'})
444
-        }
445
-    }
446
-
447
-    complete_apps = ['order']

+ 0
- 430
oscar/apps/order/migrations/0004_auto__add_field_paymentevent_amount.py Visa fil

1
-# encoding: utf-8
2
-import datetime
3
-from south.db import db
4
-from south.v2 import SchemaMigration
5
-from django.db import models
6
-
7
-class Migration(SchemaMigration):
8
-
9
-    def forwards(self, orm):
10
-        
11
-        # Adding field 'PaymentEvent.amount'
12
-        db.add_column('order_paymentevent', 'amount', self.gf('django.db.models.fields.DecimalField')(default=0, max_digits=12, decimal_places=2), keep_default=False)
13
-
14
-
15
-    def backwards(self, orm):
16
-        
17
-        # Deleting field 'PaymentEvent.amount'
18
-        db.delete_column('order_paymentevent', 'amount')
19
-
20
-
21
-    models = {
22
-        'address.country': {
23
-            'Meta': {'ordering': "('-is_highlighted', 'name')", 'object_name': 'Country'},
24
-            'is_highlighted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
25
-            'is_shipping_country': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
26
-            'iso_3166_1_a2': ('django.db.models.fields.CharField', [], {'max_length': '2', 'primary_key': 'True'}),
27
-            'iso_3166_1_a3': ('django.db.models.fields.CharField', [], {'max_length': '3', 'null': 'True', 'db_index': 'True'}),
28
-            'iso_3166_1_numeric': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'db_index': 'True'}),
29
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
30
-            'printable_name': ('django.db.models.fields.CharField', [], {'max_length': '128'})
31
-        },
32
-        'auth.group': {
33
-            'Meta': {'object_name': 'Group'},
34
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
35
-            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
36
-            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
37
-        },
38
-        'auth.permission': {
39
-            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
40
-            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
41
-            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
42
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
43
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
44
-        },
45
-        'auth.user': {
46
-            'Meta': {'object_name': 'User'},
47
-            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
48
-            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
49
-            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
50
-            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
51
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
52
-            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
53
-            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
54
-            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
55
-            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
56
-            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
57
-            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
58
-            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
59
-            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
60
-        },
61
-        'basket.basket': {
62
-            'Meta': {'object_name': 'Basket'},
63
-            'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
64
-            'date_merged': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
65
-            'date_submitted': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
66
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
67
-            'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'baskets'", 'null': 'True', 'to': "orm['auth.User']"}),
68
-            'status': ('django.db.models.fields.CharField', [], {'default': "'Open'", 'max_length': '128'}),
69
-            'vouchers': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['voucher.Voucher']", 'null': 'True', 'symmetrical': 'False'})
70
-        },
71
-        'catalogue.attributeentity': {
72
-            'Meta': {'object_name': 'AttributeEntity'},
73
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
74
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
75
-            'slug': ('django.db.models.fields.SlugField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}),
76
-            'type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'entities'", 'to': "orm['catalogue.AttributeEntityType']"})
77
-        },
78
-        'catalogue.attributeentitytype': {
79
-            'Meta': {'object_name': 'AttributeEntityType'},
80
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
81
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
82
-            'slug': ('django.db.models.fields.SlugField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'})
83
-        },
84
-        'catalogue.attributeoption': {
85
-            'Meta': {'object_name': 'AttributeOption'},
86
-            'group': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'options'", 'to': "orm['catalogue.AttributeOptionGroup']"}),
87
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
88
-            'option': ('django.db.models.fields.CharField', [], {'max_length': '255'})
89
-        },
90
-        'catalogue.attributeoptiongroup': {
91
-            'Meta': {'object_name': 'AttributeOptionGroup'},
92
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
93
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'})
94
-        },
95
-        'catalogue.category': {
96
-            'Meta': {'ordering': "['name']", 'object_name': 'Category'},
97
-            'depth': ('django.db.models.fields.PositiveIntegerField', [], {}),
98
-            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
99
-            'full_name': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'db_index': 'True'}),
100
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
101
-            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
102
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),
103
-            'numchild': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
104
-            'path': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
105
-            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '1024', 'db_index': 'True'})
106
-        },
107
-        'catalogue.option': {
108
-            'Meta': {'object_name': 'Option'},
109
-            'code': ('django.db.models.fields.SlugField', [], {'max_length': '128', 'db_index': 'True'}),
110
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
111
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
112
-            'type': ('django.db.models.fields.CharField', [], {'default': "'Required'", 'max_length': '128'})
113
-        },
114
-        'catalogue.product': {
115
-            'Meta': {'ordering': "['-date_created']", 'object_name': 'Product'},
116
-            'attributes': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.ProductAttribute']", 'through': "orm['catalogue.ProductAttributeValue']", 'symmetrical': 'False'}),
117
-            'categories': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.Category']", 'through': "orm['catalogue.ProductCategory']", 'symmetrical': 'False'}),
118
-            'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
119
-            'date_updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
120
-            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
121
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
122
-            'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'variants'", 'null': 'True', 'to': "orm['catalogue.Product']"}),
123
-            'product_class': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.ProductClass']", 'null': 'True'}),
124
-            'product_options': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.Option']", 'symmetrical': 'False', 'blank': 'True'}),
125
-            'recommended_products': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.Product']", 'symmetrical': 'False', 'through': "orm['catalogue.ProductRecommendation']", 'blank': 'True'}),
126
-            'related_products': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'relations'", 'blank': 'True', 'to': "orm['catalogue.Product']"}),
127
-            'score': ('django.db.models.fields.FloatField', [], {'default': '0.0', 'db_index': 'True'}),
128
-            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '255', 'db_index': 'True'}),
129
-            'status': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '128', 'null': 'True', 'blank': 'True'}),
130
-            'title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
131
-            'upc': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '64', 'null': 'True', 'blank': 'True'})
132
-        },
133
-        'catalogue.productattribute': {
134
-            'Meta': {'ordering': "['code']", 'object_name': 'ProductAttribute'},
135
-            'code': ('django.db.models.fields.SlugField', [], {'max_length': '128', 'db_index': 'True'}),
136
-            'entity_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.AttributeEntityType']", 'null': 'True', 'blank': 'True'}),
137
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
138
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
139
-            'option_group': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.AttributeOptionGroup']", 'null': 'True', 'blank': 'True'}),
140
-            'product_class': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'attributes'", 'null': 'True', 'to': "orm['catalogue.ProductClass']"}),
141
-            'required': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
142
-            'type': ('django.db.models.fields.CharField', [], {'default': "'text'", 'max_length': '20'})
143
-        },
144
-        'catalogue.productattributevalue': {
145
-            'Meta': {'object_name': 'ProductAttributeValue'},
146
-            'attribute': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.ProductAttribute']"}),
147
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
148
-            'product': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'attribute_values'", 'to': "orm['catalogue.Product']"}),
149
-            'value_boolean': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
150
-            'value_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
151
-            'value_entity': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.AttributeEntity']", 'null': 'True', 'blank': 'True'}),
152
-            'value_float': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
153
-            'value_integer': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
154
-            'value_option': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.AttributeOption']", 'null': 'True', 'blank': 'True'}),
155
-            'value_richtext': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
156
-            'value_text': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'})
157
-        },
158
-        'catalogue.productcategory': {
159
-            'Meta': {'ordering': "['-is_canonical']", 'object_name': 'ProductCategory'},
160
-            'category': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Category']"}),
161
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
162
-            'is_canonical': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
163
-            'product': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Product']"})
164
-        },
165
-        'catalogue.productclass': {
166
-            'Meta': {'ordering': "['name']", 'object_name': 'ProductClass'},
167
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
168
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
169
-            'options': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.Option']", 'symmetrical': 'False', 'blank': 'True'}),
170
-            'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'})
171
-        },
172
-        'catalogue.productrecommendation': {
173
-            'Meta': {'object_name': 'ProductRecommendation'},
174
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
175
-            'primary': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'primary_recommendations'", 'to': "orm['catalogue.Product']"}),
176
-            'ranking': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0'}),
177
-            'recommendation': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Product']"})
178
-        },
179
-        'contenttypes.contenttype': {
180
-            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
181
-            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
182
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
183
-            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
184
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
185
-        },
186
-        'customer.communicationeventtype': {
187
-            'Meta': {'object_name': 'CommunicationEventType'},
188
-            'category': ('django.db.models.fields.CharField', [], {'default': "'Order related'", 'max_length': '255'}),
189
-            'code': ('django.db.models.fields.SlugField', [], {'max_length': '128', 'db_index': 'True'}),
190
-            'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
191
-            'date_updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
192
-            'email_body_html_template': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
193
-            'email_body_template': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
194
-            'email_subject_template': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
195
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
196
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
197
-            'sms_template': ('django.db.models.fields.CharField', [], {'max_length': '170', 'blank': 'True'})
198
-        },
199
-        'offer.benefit': {
200
-            'Meta': {'object_name': 'Benefit'},
201
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
202
-            'max_affected_items': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
203
-            'range': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['offer.Range']", 'null': 'True', 'blank': 'True'}),
204
-            'type': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
205
-            'value': ('oscar.models.fields.PositiveDecimalField', [], {'null': 'True', 'max_digits': '12', 'decimal_places': '2', 'blank': 'True'})
206
-        },
207
-        'offer.condition': {
208
-            'Meta': {'object_name': 'Condition'},
209
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
210
-            'range': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['offer.Range']"}),
211
-            'type': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
212
-            'value': ('oscar.models.fields.PositiveDecimalField', [], {'max_digits': '12', 'decimal_places': '2'})
213
-        },
214
-        'offer.conditionaloffer': {
215
-            'Meta': {'ordering': "['-priority']", 'object_name': 'ConditionalOffer'},
216
-            'benefit': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['offer.Benefit']"}),
217
-            'condition': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['offer.Condition']"}),
218
-            'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
219
-            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
220
-            'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
221
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
222
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
223
-            'offer_type': ('django.db.models.fields.CharField', [], {'default': "'Site'", 'max_length': '128'}),
224
-            'priority': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
225
-            'redirect_url': ('oscar.models.fields.ExtendedURLField', [], {'max_length': '200', 'blank': 'True'}),
226
-            'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
227
-            'total_discount': ('django.db.models.fields.DecimalField', [], {'default': "'0.00'", 'max_digits': '12', 'decimal_places': '2'})
228
-        },
229
-        'offer.range': {
230
-            'Meta': {'object_name': 'Range'},
231
-            'classes': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'classes'", 'blank': 'True', 'to': "orm['catalogue.ProductClass']"}),
232
-            'excluded_products': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'excludes'", 'blank': 'True', 'to': "orm['catalogue.Product']"}),
233
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
234
-            'included_categories': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'includes'", 'blank': 'True', 'to': "orm['catalogue.Category']"}),
235
-            'included_products': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'includes'", 'blank': 'True', 'to': "orm['catalogue.Product']"}),
236
-            'includes_all_products': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
237
-            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'})
238
-        },
239
-        'order.billingaddress': {
240
-            'Meta': {'object_name': 'BillingAddress'},
241
-            'country': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['address.Country']"}),
242
-            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
243
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
244
-            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
245
-            'line1': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
246
-            'line2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
247
-            'line3': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
248
-            'line4': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
249
-            'postcode': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
250
-            'search_text': ('django.db.models.fields.CharField', [], {'max_length': '1000'}),
251
-            'state': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
252
-            'title': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'})
253
-        },
254
-        'order.communicationevent': {
255
-            'Meta': {'object_name': 'CommunicationEvent'},
256
-            'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
257
-            'event_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['customer.CommunicationEventType']"}),
258
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
259
-            'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'communication_events'", 'to': "orm['order.Order']"})
260
-        },
261
-        'order.line': {
262
-            'Meta': {'object_name': 'Line'},
263
-            'est_dispatch_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
264
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
265
-            'line_price_before_discounts_excl_tax': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '2'}),
266
-            'line_price_before_discounts_incl_tax': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '2'}),
267
-            'line_price_excl_tax': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '2'}),
268
-            'line_price_incl_tax': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '2'}),
269
-            'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'lines'", 'to': "orm['order.Order']"}),
270
-            'partner': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'order_lines'", 'null': 'True', 'to': "orm['partner.Partner']"}),
271
-            'partner_line_notes': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
272
-            'partner_line_reference': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
273
-            'partner_name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
274
-            'partner_sku': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
275
-            'product': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Product']", 'null': 'True', 'blank': 'True'}),
276
-            'quantity': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}),
277
-            'status': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
278
-            'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
279
-            'unit_cost_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '12', 'decimal_places': '2', 'blank': 'True'}),
280
-            'unit_price_excl_tax': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '12', 'decimal_places': '2', 'blank': 'True'}),
281
-            'unit_price_incl_tax': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '12', 'decimal_places': '2', 'blank': 'True'}),
282
-            'unit_retail_price': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '12', 'decimal_places': '2', 'blank': 'True'})
283
-        },
284
-        'order.lineattribute': {
285
-            'Meta': {'object_name': 'LineAttribute'},
286
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
287
-            'line': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'attributes'", 'to': "orm['order.Line']"}),
288
-            'option': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'line_attributes'", 'null': 'True', 'to': "orm['catalogue.Option']"}),
289
-            'type': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
290
-            'value': ('django.db.models.fields.CharField', [], {'max_length': '255'})
291
-        },
292
-        'order.lineprice': {
293
-            'Meta': {'object_name': 'LinePrice'},
294
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
295
-            'line': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'prices'", 'to': "orm['order.Line']"}),
296
-            'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'line_prices'", 'to': "orm['order.Order']"}),
297
-            'price_excl_tax': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '2'}),
298
-            'price_incl_tax': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '2'}),
299
-            'quantity': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}),
300
-            'shipping_excl_tax': ('django.db.models.fields.DecimalField', [], {'default': '0', 'max_digits': '12', 'decimal_places': '2'}),
301
-            'shipping_incl_tax': ('django.db.models.fields.DecimalField', [], {'default': '0', 'max_digits': '12', 'decimal_places': '2'})
302
-        },
303
-        'order.order': {
304
-            'Meta': {'ordering': "['-date_placed']", 'object_name': 'Order'},
305
-            'basket': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['basket.Basket']", 'null': 'True', 'blank': 'True'}),
306
-            'billing_address': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['order.BillingAddress']", 'null': 'True', 'blank': 'True'}),
307
-            'date_placed': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
308
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
309
-            'number': ('django.db.models.fields.CharField', [], {'max_length': '128', 'db_index': 'True'}),
310
-            'shipping_address': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['order.ShippingAddress']", 'null': 'True', 'blank': 'True'}),
311
-            'shipping_excl_tax': ('django.db.models.fields.DecimalField', [], {'default': '0', 'max_digits': '12', 'decimal_places': '2'}),
312
-            'shipping_incl_tax': ('django.db.models.fields.DecimalField', [], {'default': '0', 'max_digits': '12', 'decimal_places': '2'}),
313
-            'shipping_method': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
314
-            'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}),
315
-            'status': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
316
-            'total_excl_tax': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '2'}),
317
-            'total_incl_tax': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '2'}),
318
-            'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'orders'", 'null': 'True', 'to': "orm['auth.User']"})
319
-        },
320
-        'order.orderdiscount': {
321
-            'Meta': {'object_name': 'OrderDiscount'},
322
-            'amount': ('django.db.models.fields.DecimalField', [], {'default': '0', 'max_digits': '12', 'decimal_places': '2'}),
323
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
324
-            'offer': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['offer.ConditionalOffer']", 'null': 'True'}),
325
-            'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'discounts'", 'to': "orm['order.Order']"}),
326
-            'voucher': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'discount_vouchers'", 'null': 'True', 'to': "orm['voucher.Voucher']"}),
327
-            'voucher_code': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'db_index': 'True'})
328
-        },
329
-        'order.ordernote': {
330
-            'Meta': {'object_name': 'OrderNote'},
331
-            'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
332
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
333
-            'message': ('django.db.models.fields.TextField', [], {}),
334
-            'note_type': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True'}),
335
-            'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'notes'", 'to': "orm['order.Order']"}),
336
-            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True'})
337
-        },
338
-        'order.paymentevent': {
339
-            'Meta': {'object_name': 'PaymentEvent'},
340
-            'amount': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '2'}),
341
-            'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
342
-            'event_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['order.PaymentEventType']"}),
343
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
344
-            'lines': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['order.Line']", 'through': "orm['order.PaymentEventQuantity']", 'symmetrical': 'False'}),
345
-            'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'payment_events'", 'to': "orm['order.Order']"})
346
-        },
347
-        'order.paymenteventquantity': {
348
-            'Meta': {'object_name': 'PaymentEventQuantity'},
349
-            'event': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'line_quantities'", 'to': "orm['order.PaymentEvent']"}),
350
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
351
-            'line': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['order.Line']"}),
352
-            'quantity': ('django.db.models.fields.PositiveIntegerField', [], {})
353
-        },
354
-        'order.paymenteventtype': {
355
-            'Meta': {'ordering': "('sequence_number',)", 'object_name': 'PaymentEventType'},
356
-            'code': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}),
357
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
358
-            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}),
359
-            'sequence_number': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'})
360
-        },
361
-        'order.shippingaddress': {
362
-            'Meta': {'object_name': 'ShippingAddress'},
363
-            'country': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['address.Country']"}),
364
-            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
365
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
366
-            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
367
-            'line1': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
368
-            'line2': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
369
-            'line3': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
370
-            'line4': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
371
-            'notes': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
372
-            'phone_number': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
373
-            'postcode': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
374
-            'search_text': ('django.db.models.fields.CharField', [], {'max_length': '1000'}),
375
-            'state': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
376
-            'title': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True', 'blank': 'True'})
377
-        },
378
-        'order.shippingevent': {
379
-            'Meta': {'ordering': "['-date']", 'object_name': 'ShippingEvent'},
380
-            'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
381
-            'event_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['order.ShippingEventType']"}),
382
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
383
-            'lines': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['order.Line']", 'through': "orm['order.ShippingEventQuantity']", 'symmetrical': 'False'}),
384
-            'notes': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
385
-            'order': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'shipping_events'", 'to': "orm['order.Order']"})
386
-        },
387
-        'order.shippingeventquantity': {
388
-            'Meta': {'object_name': 'ShippingEventQuantity'},
389
-            'event': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'line_quantities'", 'to': "orm['order.ShippingEvent']"}),
390
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
391
-            'line': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['order.Line']"}),
392
-            'quantity': ('django.db.models.fields.PositiveIntegerField', [], {})
393
-        },
394
-        'order.shippingeventtype': {
395
-            'Meta': {'ordering': "('sequence_number',)", 'object_name': 'ShippingEventType'},
396
-            'code': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}),
397
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
398
-            'is_required': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
399
-            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
400
-            'sequence_number': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'})
401
-        },
402
-        'partner.partner': {
403
-            'Meta': {'object_name': 'Partner'},
404
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
405
-            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}),
406
-            'users': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'partners'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['auth.User']"})
407
-        },
408
-        'sites.site': {
409
-            'Meta': {'ordering': "('domain',)", 'object_name': 'Site', 'db_table': "'django_site'"},
410
-            'domain': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
411
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
412
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
413
-        },
414
-        'voucher.voucher': {
415
-            'Meta': {'object_name': 'Voucher'},
416
-            'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'}),
417
-            'date_created': ('django.db.models.fields.DateField', [], {'auto_now_add': 'True', 'blank': 'True'}),
418
-            'end_date': ('django.db.models.fields.DateField', [], {}),
419
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
420
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
421
-            'num_basket_additions': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
422
-            'num_orders': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
423
-            'offers': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'vouchers'", 'symmetrical': 'False', 'to': "orm['offer.ConditionalOffer']"}),
424
-            'start_date': ('django.db.models.fields.DateField', [], {}),
425
-            'total_discount': ('django.db.models.fields.DecimalField', [], {'default': "'0.00'", 'max_digits': '12', 'decimal_places': '2'}),
426
-            'usage': ('django.db.models.fields.CharField', [], {'default': "'Multi-use'", 'max_length': '128'})
427
-        }
428
-    }
429
-
430
-    complete_apps = ['order']

+ 18
- 2
oscar/apps/order/tests.py Visa fil

10
 from oscar.apps.basket.models import Basket
10
 from oscar.apps.basket.models import Basket
11
 from oscar.apps.order.models import ShippingAddress, Order, Line, \
11
 from oscar.apps.order.models import ShippingAddress, Order, Line, \
12
         ShippingEvent, ShippingEventType, ShippingEventQuantity, OrderNote, \
12
         ShippingEvent, ShippingEventType, ShippingEventQuantity, OrderNote, \
13
-        ShippingEventType
13
+        ShippingEventType, OrderDiscount
14
 from oscar.apps.order.exceptions import (InvalidOrderStatus, InvalidLineStatus,
14
 from oscar.apps.order.exceptions import (InvalidOrderStatus, InvalidLineStatus,
15
                                          InvalidShippingEvent)
15
                                          InvalidShippingEvent)
16
-from oscar.test.helpers import create_order, create_product
16
+from oscar.test.helpers import create_order, create_product, create_offer
17
 from oscar.apps.order.utils import OrderCreator
17
 from oscar.apps.order.utils import OrderCreator
18
 from oscar.apps.shipping.methods import Free
18
 from oscar.apps.shipping.methods import Free
19
 from oscar.apps.order.processing import EventHandler
19
 from oscar.apps.order.processing import EventHandler
385
         self.assertEqual(1, len(events))
385
         self.assertEqual(1, len(events))
386
         event = events[0]
386
         event = events[0]
387
         self.assertEqual('Shipped', event.event_type.name)
387
         self.assertEqual('Shipped', event.event_type.name)
388
+
389
+
390
+class OrderDiscountTests(TestCase):
391
+
392
+    def test_creation_without_offer_or_voucher(self):
393
+        order = create_order(number='100002')
394
+        discount = OrderDiscount.objects.create(order=order, amount=D('10.00'))
395
+        self.assertTrue(discount.voucher is None)
396
+        self.assertTrue(discount.offer is None)
397
+
398
+    def test_creation_with_offer(self):
399
+        offer = create_offer()
400
+        order = create_order(number='100002')
401
+        discount = OrderDiscount.objects.create(order=order, amount=D('10.00'),
402
+                                                offer_id=offer.id)
403
+        self.assertEqual(offer.id, discount.offer.id)

+ 5
- 3
oscar/apps/order/utils.py Visa fil

79
         """
79
         """
80
         Creates an order model.
80
         Creates an order model.
81
         """
81
         """
82
-        order_data = {'basket': basket,
82
+        order_data = {'basket_id': basket.id,
83
                       'number': order_number,
83
                       'number': order_number,
84
                       'site': Site._default_manager.get_current(),
84
                       'site': Site._default_manager.get_current(),
85
                       'total_incl_tax': total_incl_tax,
85
                       'total_incl_tax': total_incl_tax,
192
         """
192
         """
193
         Creates an order discount model for each discount attached to the basket.
193
         Creates an order discount model for each discount attached to the basket.
194
         """
194
         """
195
-        order_discount = OrderDiscount(order=order, offer=discount['offer'], amount=discount['discount'])
195
+        order_discount = OrderDiscount(order=order,
196
+                                       offer_id=discount['offer'].id, 
197
+                                       amount=discount['discount'])
196
         if discount['voucher']:
198
         if discount['voucher']:
197
-            order_discount.voucher = discount['voucher']
199
+            order_discount.voucher_id = discount['voucher'].id
198
             order_discount.voucher_code = discount['voucher'].code
200
             order_discount.voucher_code = discount['voucher'].code
199
         order_discount.save()
201
         order_discount.save()
200
         
202
         

+ 1
- 0
oscar/apps/partner/abstract_models.py Visa fil

19
     module = django_import_module(module_str)
19
     module = django_import_module(module_str)
20
     partner_wrappers[partner] = getattr(module, class_name)()
20
     partner_wrappers[partner] = getattr(module, class_name)()
21
 
21
 
22
+
22
 def get_partner_wrapper(partner_name):
23
 def get_partner_wrapper(partner_name):
23
     """
24
     """
24
     Returns the appropriate partner wrapper given the partner name
25
     Returns the appropriate partner wrapper given the partner name

+ 20
- 0
oscar/test/helpers.py Visa fil

12
 from oscar.apps.order.utils import OrderCreator
12
 from oscar.apps.order.utils import OrderCreator
13
 from oscar.apps.partner.models import Partner, StockRecord
13
 from oscar.apps.partner.models import Partner, StockRecord
14
 from oscar.apps.shipping.methods import Free
14
 from oscar.apps.shipping.methods import Free
15
+from oscar.apps.offer.models import Range, ConditionalOffer, Condition, Benefit
15
 
16
 
16
 
17
 
17
 def create_product(price=None, title="Dummy title", product_class="Dummy item class", 
18
 def create_product(price=None, title="Dummy title", product_class="Dummy item class", 
63
     return order
64
     return order
64
 
65
 
65
 
66
 
67
+def create_offer():
68
+    range = Range.objects.create(name="All products range", includes_all_products=True)
69
+    condition = Condition.objects.create(range=range,
70
+                                         type=Condition.COUNT,
71
+                                         value=1)
72
+    benefit = Benefit.objects.create(range=range,
73
+                                     type=Benefit.PERCENTAGE,
74
+                                     value=20)
75
+    offer= ConditionalOffer.objects.create(
76
+        name='Dummy offer',
77
+        offer_type='Site',
78
+        condition=condition,
79
+        benefit=benefit
80
+    )
81
+    return offer
82
+
83
+
84
+
85
+
66
 class TwillTestCase(TestCase):
86
 class TwillTestCase(TestCase):
67
     """
87
     """
68
     Simple wrapper around Twill to make writing TestCases easier.
88
     Simple wrapper around Twill to make writing TestCases easier.

Laddar…
Avbryt
Spara