/oscar/apps/offer/migrations/0003_auto__add_field_conditionaloffer_num_orders.py

https://github.com/anthony-tresontani/django-oscar · Python · 173 lines · 161 code · 9 blank · 3 comment · 0 complexity · 34b5025dfa689b067d9c5dcb27c3a9c9 MD5 · raw file

  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. class Migration(SchemaMigration):
  7. def forwards(self, orm):
  8. # Adding field 'ConditionalOffer.num_orders'
  9. db.add_column('offer_conditionaloffer', 'num_orders', self.gf('django.db.models.fields.PositiveIntegerField')(default=0), keep_default=False)
  10. def backwards(self, orm):
  11. # Deleting field 'ConditionalOffer.num_orders'
  12. db.delete_column('offer_conditionaloffer', 'num_orders')
  13. models = {
  14. 'catalogue.attributeentity': {
  15. 'Meta': {'object_name': 'AttributeEntity'},
  16. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  17. 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
  18. 'slug': ('django.db.models.fields.SlugField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}),
  19. 'type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'entities'", 'to': "orm['catalogue.AttributeEntityType']"})
  20. },
  21. 'catalogue.attributeentitytype': {
  22. 'Meta': {'object_name': 'AttributeEntityType'},
  23. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  24. 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
  25. 'slug': ('django.db.models.fields.SlugField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'})
  26. },
  27. 'catalogue.attributeoption': {
  28. 'Meta': {'object_name': 'AttributeOption'},
  29. 'group': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'options'", 'to': "orm['catalogue.AttributeOptionGroup']"}),
  30. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  31. 'option': ('django.db.models.fields.CharField', [], {'max_length': '255'})
  32. },
  33. 'catalogue.attributeoptiongroup': {
  34. 'Meta': {'object_name': 'AttributeOptionGroup'},
  35. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  36. 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'})
  37. },
  38. 'catalogue.category': {
  39. 'Meta': {'ordering': "['name']", 'object_name': 'Category'},
  40. 'depth': ('django.db.models.fields.PositiveIntegerField', [], {}),
  41. 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
  42. 'full_name': ('django.db.models.fields.CharField', [], {'max_length': '1024', 'db_index': 'True'}),
  43. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  44. 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
  45. 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),
  46. 'numchild': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
  47. 'path': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
  48. 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '1024', 'db_index': 'True'})
  49. },
  50. 'catalogue.option': {
  51. 'Meta': {'object_name': 'Option'},
  52. 'code': ('django.db.models.fields.SlugField', [], {'max_length': '128', 'db_index': 'True'}),
  53. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  54. 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
  55. 'type': ('django.db.models.fields.CharField', [], {'default': "'Required'", 'max_length': '128'})
  56. },
  57. 'catalogue.product': {
  58. 'Meta': {'ordering': "['-date_created']", 'object_name': 'Product'},
  59. 'attributes': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.ProductAttribute']", 'through': "orm['catalogue.ProductAttributeValue']", 'symmetrical': 'False'}),
  60. 'categories': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.Category']", 'through': "orm['catalogue.ProductCategory']", 'symmetrical': 'False'}),
  61. 'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
  62. 'date_updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
  63. 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
  64. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  65. 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'variants'", 'null': 'True', 'to': "orm['catalogue.Product']"}),
  66. 'product_class': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.ProductClass']", 'null': 'True'}),
  67. 'product_options': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.Option']", 'symmetrical': 'False', 'blank': 'True'}),
  68. 'recommended_products': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.Product']", 'symmetrical': 'False', 'through': "orm['catalogue.ProductRecommendation']", 'blank': 'True'}),
  69. 'related_products': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'relations'", 'blank': 'True', 'to': "orm['catalogue.Product']"}),
  70. 'score': ('django.db.models.fields.FloatField', [], {'default': '0.0', 'db_index': 'True'}),
  71. 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '255', 'db_index': 'True'}),
  72. 'status': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '128', 'null': 'True', 'blank': 'True'}),
  73. 'title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
  74. 'upc': ('django.db.models.fields.CharField', [], {'max_length': '64', 'unique': 'True', 'null': 'True', 'blank': 'True'})
  75. },
  76. 'catalogue.productattribute': {
  77. 'Meta': {'ordering': "['code']", 'object_name': 'ProductAttribute'},
  78. 'code': ('django.db.models.fields.SlugField', [], {'max_length': '128', 'db_index': 'True'}),
  79. 'entity_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.AttributeEntityType']", 'null': 'True', 'blank': 'True'}),
  80. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  81. 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
  82. 'option_group': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.AttributeOptionGroup']", 'null': 'True', 'blank': 'True'}),
  83. 'product_class': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'attributes'", 'null': 'True', 'to': "orm['catalogue.ProductClass']"}),
  84. 'required': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
  85. 'type': ('django.db.models.fields.CharField', [], {'default': "'text'", 'max_length': '20'})
  86. },
  87. 'catalogue.productattributevalue': {
  88. 'Meta': {'object_name': 'ProductAttributeValue'},
  89. 'attribute': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.ProductAttribute']"}),
  90. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  91. 'product': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'attribute_values'", 'to': "orm['catalogue.Product']"}),
  92. 'value_boolean': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
  93. 'value_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
  94. 'value_entity': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.AttributeEntity']", 'null': 'True', 'blank': 'True'}),
  95. 'value_float': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
  96. 'value_integer': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
  97. 'value_option': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.AttributeOption']", 'null': 'True', 'blank': 'True'}),
  98. 'value_richtext': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
  99. 'value_text': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'})
  100. },
  101. 'catalogue.productcategory': {
  102. 'Meta': {'ordering': "['-is_canonical']", 'object_name': 'ProductCategory'},
  103. 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Category']"}),
  104. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  105. 'is_canonical': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
  106. 'product': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Product']"})
  107. },
  108. 'catalogue.productclass': {
  109. 'Meta': {'ordering': "['name']", 'object_name': 'ProductClass'},
  110. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  111. 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
  112. 'options': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.Option']", 'symmetrical': 'False', 'blank': 'True'}),
  113. 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '128', 'db_index': 'True'})
  114. },
  115. 'catalogue.productrecommendation': {
  116. 'Meta': {'object_name': 'ProductRecommendation'},
  117. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  118. 'primary': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'primary_recommendations'", 'to': "orm['catalogue.Product']"}),
  119. 'ranking': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0'}),
  120. 'recommendation': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Product']"})
  121. },
  122. 'offer.benefit': {
  123. 'Meta': {'object_name': 'Benefit'},
  124. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  125. 'max_affected_items': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
  126. 'range': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['offer.Range']", 'null': 'True', 'blank': 'True'}),
  127. 'type': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
  128. 'value': ('oscar.models.fields.PositiveDecimalField', [], {'null': 'True', 'max_digits': '12', 'decimal_places': '2', 'blank': 'True'})
  129. },
  130. 'offer.condition': {
  131. 'Meta': {'object_name': 'Condition'},
  132. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  133. 'range': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['offer.Range']"}),
  134. 'type': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
  135. 'value': ('oscar.models.fields.PositiveDecimalField', [], {'max_digits': '12', 'decimal_places': '2'})
  136. },
  137. 'offer.conditionaloffer': {
  138. 'Meta': {'ordering': "['-priority']", 'object_name': 'ConditionalOffer'},
  139. 'benefit': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['offer.Benefit']"}),
  140. 'condition': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['offer.Condition']"}),
  141. 'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
  142. 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
  143. 'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
  144. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  145. 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}),
  146. 'num_orders': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
  147. 'offer_type': ('django.db.models.fields.CharField', [], {'default': "'Site'", 'max_length': '128'}),
  148. 'priority': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
  149. 'redirect_url': ('oscar.models.fields.ExtendedURLField', [], {'max_length': '200', 'blank': 'True'}),
  150. 'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
  151. 'total_discount': ('django.db.models.fields.DecimalField', [], {'default': "'0.00'", 'max_digits': '12', 'decimal_places': '2'})
  152. },
  153. 'offer.range': {
  154. 'Meta': {'object_name': 'Range'},
  155. 'classes': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'classes'", 'blank': 'True', 'to': "orm['catalogue.ProductClass']"}),
  156. 'excluded_products': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'excludes'", 'blank': 'True', 'to': "orm['catalogue.Product']"}),
  157. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  158. 'included_categories': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'includes'", 'blank': 'True', 'to': "orm['catalogue.Category']"}),
  159. 'included_products': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'includes'", 'blank': 'True', 'to': "orm['catalogue.Product']"}),
  160. 'includes_all_products': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
  161. 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'})
  162. }
  163. }
  164. complete_apps = ['offer']