You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

0001_initial.py 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. # -*- coding: utf-8 -*-
  2. import datetime
  3. from south.db import db
  4. from south.v2 import SchemaMigration
  5. from django.db import models
  6. from oscar.core.compat import AUTH_USER_MODEL, AUTH_USER_MODEL_NAME
  7. class Migration(SchemaMigration):
  8. def forwards(self, orm):
  9. # Adding model 'WishList'
  10. db.create_table('wishlists_wishlist', (
  11. ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
  12. ('owner', self.gf('django.db.models.fields.related.ForeignKey')(related_name='wishlists', to=orm[AUTH_USER_MODEL])),
  13. ('name', self.gf('django.db.models.fields.CharField')(default=u'New Wish List', max_length=255)),
  14. ('key', self.gf('django.db.models.fields.CharField')(unique=True, max_length=6, db_index=True)),
  15. ('visibility', self.gf('django.db.models.fields.CharField')(default='Private', max_length=20)),
  16. ('date_created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
  17. ))
  18. db.send_create_signal('wishlists', ['WishList'])
  19. # Adding model 'Line'
  20. db.create_table('wishlists_line', (
  21. ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
  22. ('wishlist', self.gf('django.db.models.fields.related.ForeignKey')(related_name='lines', to=orm['wishlists.WishList'])),
  23. ('product', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='wishlists_lines', null=True, on_delete=models.SET_NULL, to=orm['catalogue.Product'])),
  24. ('quantity', self.gf('django.db.models.fields.PositiveIntegerField')(default=1)),
  25. ('title', self.gf('django.db.models.fields.CharField')(max_length=255)),
  26. ))
  27. db.send_create_signal('wishlists', ['Line'])
  28. # Adding unique constraint on 'Line', fields ['wishlist', 'product']
  29. db.create_unique('wishlists_line', ['wishlist_id', 'product_id'])
  30. def backwards(self, orm):
  31. # Removing unique constraint on 'Line', fields ['wishlist', 'product']
  32. db.delete_unique('wishlists_line', ['wishlist_id', 'product_id'])
  33. # Deleting model 'WishList'
  34. db.delete_table('wishlists_wishlist')
  35. # Deleting model 'Line'
  36. db.delete_table('wishlists_line')
  37. models = {
  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_MODEL: {
  52. 'Meta': {'object_name': AUTH_USER_MODEL_NAME},
  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. 'catalogue.attributeentity': {
  68. 'Meta': {'object_name': 'AttributeEntity'},
  69. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  70. 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
  71. 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '255', 'blank': 'True'}),
  72. 'type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'entities'", 'to': "orm['catalogue.AttributeEntityType']"})
  73. },
  74. 'catalogue.attributeentitytype': {
  75. 'Meta': {'object_name': 'AttributeEntityType'},
  76. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  77. 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
  78. 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '255', 'blank': 'True'})
  79. },
  80. 'catalogue.attributeoption': {
  81. 'Meta': {'object_name': 'AttributeOption'},
  82. 'group': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'options'", 'to': "orm['catalogue.AttributeOptionGroup']"}),
  83. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  84. 'option': ('django.db.models.fields.CharField', [], {'max_length': '255'})
  85. },
  86. 'catalogue.attributeoptiongroup': {
  87. 'Meta': {'object_name': 'AttributeOptionGroup'},
  88. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  89. 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'})
  90. },
  91. 'catalogue.category': {
  92. 'Meta': {'ordering': "['full_name']", 'object_name': 'Category'},
  93. 'depth': ('django.db.models.fields.PositiveIntegerField', [], {}),
  94. 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
  95. 'full_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),
  96. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  97. 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
  98. 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),
  99. 'numchild': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
  100. 'path': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
  101. 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '255'})
  102. },
  103. 'catalogue.option': {
  104. 'Meta': {'object_name': 'Option'},
  105. 'code': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '128'}),
  106. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  107. 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
  108. 'type': ('django.db.models.fields.CharField', [], {'default': "'Required'", 'max_length': '128'})
  109. },
  110. 'catalogue.product': {
  111. 'Meta': {'ordering': "['-date_created']", 'object_name': 'Product'},
  112. 'attributes': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.ProductAttribute']", 'through': "orm['catalogue.ProductAttributeValue']", 'symmetrical': 'False'}),
  113. 'categories': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.Category']", 'through': "orm['catalogue.ProductCategory']", 'symmetrical': 'False'}),
  114. 'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
  115. 'date_updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
  116. 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
  117. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  118. 'is_discountable': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
  119. 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'variants'", 'null': 'True', 'to': "orm['catalogue.Product']"}),
  120. 'product_class': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.ProductClass']", 'null': 'True'}),
  121. 'product_options': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.Option']", 'symmetrical': 'False', 'blank': 'True'}),
  122. 'rating': ('django.db.models.fields.FloatField', [], {'null': 'True'}),
  123. 'recommended_products': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.Product']", 'symmetrical': 'False', 'through': "orm['catalogue.ProductRecommendation']", 'blank': 'True'}),
  124. 'related_products': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'relations'", 'blank': 'True', 'to': "orm['catalogue.Product']"}),
  125. 'score': ('django.db.models.fields.FloatField', [], {'default': '0.0', 'db_index': 'True'}),
  126. 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '255'}),
  127. 'status': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '128', 'null': 'True', 'blank': 'True'}),
  128. 'title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
  129. 'upc': ('django.db.models.fields.CharField', [], {'max_length': '64', 'unique': 'True', 'null': 'True', 'blank': 'True'})
  130. },
  131. 'catalogue.productattribute': {
  132. 'Meta': {'ordering': "['code']", 'object_name': 'ProductAttribute'},
  133. 'code': ('django.db.models.fields.SlugField', [], {'max_length': '128'}),
  134. 'entity_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.AttributeEntityType']", 'null': 'True', 'blank': 'True'}),
  135. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  136. 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
  137. 'option_group': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.AttributeOptionGroup']", 'null': 'True', 'blank': 'True'}),
  138. 'product_class': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'attributes'", 'null': 'True', 'to': "orm['catalogue.ProductClass']"}),
  139. 'required': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
  140. 'type': ('django.db.models.fields.CharField', [], {'default': "'text'", 'max_length': '20'})
  141. },
  142. 'catalogue.productattributevalue': {
  143. 'Meta': {'object_name': 'ProductAttributeValue'},
  144. 'attribute': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.ProductAttribute']"}),
  145. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  146. 'product': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'attribute_values'", 'to': "orm['catalogue.Product']"}),
  147. 'value_boolean': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
  148. 'value_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
  149. 'value_entity': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.AttributeEntity']", 'null': 'True', 'blank': 'True'}),
  150. 'value_float': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
  151. 'value_integer': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
  152. 'value_option': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.AttributeOption']", 'null': 'True', 'blank': 'True'}),
  153. 'value_richtext': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
  154. 'value_text': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'})
  155. },
  156. 'catalogue.productcategory': {
  157. 'Meta': {'ordering': "['-is_canonical']", 'object_name': 'ProductCategory'},
  158. 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Category']"}),
  159. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  160. 'is_canonical': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
  161. 'product': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Product']"})
  162. },
  163. 'catalogue.productclass': {
  164. 'Meta': {'ordering': "['name']", 'object_name': 'ProductClass'},
  165. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  166. 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
  167. 'options': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.Option']", 'symmetrical': 'False', 'blank': 'True'}),
  168. 'requires_shipping': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
  169. 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '128'}),
  170. 'track_stock': ('django.db.models.fields.BooleanField', [], {'default': '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. 'wishlists.line': {
  187. 'Meta': {'unique_together': "(('wishlist', 'product'),)", 'object_name': 'Line'},
  188. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  189. 'product': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'wishlists_lines'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['catalogue.Product']"}),
  190. 'quantity': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}),
  191. 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
  192. 'wishlist': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'lines'", 'to': "orm['wishlists.WishList']"})
  193. },
  194. 'wishlists.wishlist': {
  195. 'Meta': {'ordering': "('owner', 'date_created')", 'object_name': 'WishList'},
  196. 'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
  197. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  198. 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '6', 'db_index': 'True'}),
  199. 'name': ('django.db.models.fields.CharField', [], {'default': "u'New Wish List'", 'max_length': '255'}),
  200. 'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'wishlists'", 'to': "orm['{0}']".format(AUTH_USER_MODEL)}),
  201. 'visibility': ('django.db.models.fields.CharField', [], {'default': "'Private'", 'max_length': '20'})
  202. }
  203. }
  204. complete_apps = ['wishlists']