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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  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. class Migration(SchemaMigration):
  7. def forwards(self, orm):
  8. # Adding model 'WishList'
  9. db.create_table('wishlists_wishlist', (
  10. ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
  11. ('owner', self.gf('django.db.models.fields.related.ForeignKey')(related_name='wishlists', to=orm['auth.User'])),
  12. ('name', self.gf('django.db.models.fields.CharField')(default=u'New Wish List', max_length=255)),
  13. ('key', self.gf('django.db.models.fields.CharField')(unique=True, max_length=6, db_index=True)),
  14. ('visibility', self.gf('django.db.models.fields.CharField')(default='Private', max_length=20)),
  15. ('date_created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
  16. ))
  17. db.send_create_signal('wishlists', ['WishList'])
  18. # Adding model 'Line'
  19. db.create_table('wishlists_line', (
  20. ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
  21. ('wishlist', self.gf('django.db.models.fields.related.ForeignKey')(related_name='lines', to=orm['wishlists.WishList'])),
  22. ('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'])),
  23. ('quantity', self.gf('django.db.models.fields.PositiveIntegerField')(default=1)),
  24. ('title', self.gf('django.db.models.fields.CharField')(max_length=255)),
  25. ))
  26. db.send_create_signal('wishlists', ['Line'])
  27. # Adding unique constraint on 'Line', fields ['wishlist', 'product']
  28. db.create_unique('wishlists_line', ['wishlist_id', 'product_id'])
  29. def backwards(self, orm):
  30. # Removing unique constraint on 'Line', fields ['wishlist', 'product']
  31. db.delete_unique('wishlists_line', ['wishlist_id', 'product_id'])
  32. # Deleting model 'WishList'
  33. db.delete_table('wishlists_wishlist')
  34. # Deleting model 'Line'
  35. db.delete_table('wishlists_line')
  36. models = {
  37. 'auth.group': {
  38. 'Meta': {'object_name': 'Group'},
  39. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  40. 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
  41. 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
  42. },
  43. 'auth.permission': {
  44. 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
  45. 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
  46. 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
  47. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  48. 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
  49. },
  50. 'auth.user': {
  51. 'Meta': {'object_name': 'User'},
  52. 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
  53. 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
  54. 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
  55. 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
  56. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  57. 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
  58. 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
  59. 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
  60. 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
  61. 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
  62. 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
  63. 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
  64. 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
  65. },
  66. 'catalogue.attributeentity': {
  67. 'Meta': {'object_name': 'AttributeEntity'},
  68. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  69. 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
  70. 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '255', 'blank': 'True'}),
  71. 'type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'entities'", 'to': "orm['catalogue.AttributeEntityType']"})
  72. },
  73. 'catalogue.attributeentitytype': {
  74. 'Meta': {'object_name': 'AttributeEntityType'},
  75. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  76. 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
  77. 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '255', 'blank': 'True'})
  78. },
  79. 'catalogue.attributeoption': {
  80. 'Meta': {'object_name': 'AttributeOption'},
  81. 'group': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'options'", 'to': "orm['catalogue.AttributeOptionGroup']"}),
  82. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  83. 'option': ('django.db.models.fields.CharField', [], {'max_length': '255'})
  84. },
  85. 'catalogue.attributeoptiongroup': {
  86. 'Meta': {'object_name': 'AttributeOptionGroup'},
  87. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  88. 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'})
  89. },
  90. 'catalogue.category': {
  91. 'Meta': {'ordering': "['full_name']", 'object_name': 'Category'},
  92. 'depth': ('django.db.models.fields.PositiveIntegerField', [], {}),
  93. 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
  94. 'full_name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),
  95. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  96. 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
  97. 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'db_index': 'True'}),
  98. 'numchild': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
  99. 'path': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
  100. 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '255'})
  101. },
  102. 'catalogue.option': {
  103. 'Meta': {'object_name': 'Option'},
  104. 'code': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '128'}),
  105. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  106. 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
  107. 'type': ('django.db.models.fields.CharField', [], {'default': "'Required'", 'max_length': '128'})
  108. },
  109. 'catalogue.product': {
  110. 'Meta': {'ordering': "['-date_created']", 'object_name': 'Product'},
  111. 'attributes': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.ProductAttribute']", 'through': "orm['catalogue.ProductAttributeValue']", 'symmetrical': 'False'}),
  112. 'categories': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.Category']", 'through': "orm['catalogue.ProductCategory']", 'symmetrical': 'False'}),
  113. 'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
  114. 'date_updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
  115. 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
  116. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  117. 'is_discountable': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
  118. 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'variants'", 'null': 'True', 'to': "orm['catalogue.Product']"}),
  119. 'product_class': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.ProductClass']", 'null': 'True'}),
  120. 'product_options': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.Option']", 'symmetrical': 'False', 'blank': 'True'}),
  121. 'rating': ('django.db.models.fields.FloatField', [], {'null': 'True'}),
  122. 'recommended_products': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.Product']", 'symmetrical': 'False', 'through': "orm['catalogue.ProductRecommendation']", 'blank': 'True'}),
  123. 'related_products': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'relations'", 'blank': 'True', 'to': "orm['catalogue.Product']"}),
  124. 'score': ('django.db.models.fields.FloatField', [], {'default': '0.0', 'db_index': 'True'}),
  125. 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '255'}),
  126. 'status': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '128', 'null': 'True', 'blank': 'True'}),
  127. 'title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
  128. 'upc': ('django.db.models.fields.CharField', [], {'max_length': '64', 'unique': 'True', 'null': 'True', 'blank': 'True'})
  129. },
  130. 'catalogue.productattribute': {
  131. 'Meta': {'ordering': "['code']", 'object_name': 'ProductAttribute'},
  132. 'code': ('django.db.models.fields.SlugField', [], {'max_length': '128'}),
  133. 'entity_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.AttributeEntityType']", 'null': 'True', 'blank': 'True'}),
  134. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  135. 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
  136. 'option_group': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.AttributeOptionGroup']", 'null': 'True', 'blank': 'True'}),
  137. 'product_class': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'attributes'", 'null': 'True', 'to': "orm['catalogue.ProductClass']"}),
  138. 'required': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
  139. 'type': ('django.db.models.fields.CharField', [], {'default': "'text'", 'max_length': '20'})
  140. },
  141. 'catalogue.productattributevalue': {
  142. 'Meta': {'object_name': 'ProductAttributeValue'},
  143. 'attribute': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.ProductAttribute']"}),
  144. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  145. 'product': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'attribute_values'", 'to': "orm['catalogue.Product']"}),
  146. 'value_boolean': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
  147. 'value_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
  148. 'value_entity': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.AttributeEntity']", 'null': 'True', 'blank': 'True'}),
  149. 'value_float': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),
  150. 'value_integer': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
  151. 'value_option': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.AttributeOption']", 'null': 'True', 'blank': 'True'}),
  152. 'value_richtext': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
  153. 'value_text': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'})
  154. },
  155. 'catalogue.productcategory': {
  156. 'Meta': {'ordering': "['-is_canonical']", 'object_name': 'ProductCategory'},
  157. 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Category']"}),
  158. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  159. 'is_canonical': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
  160. 'product': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Product']"})
  161. },
  162. 'catalogue.productclass': {
  163. 'Meta': {'ordering': "['name']", 'object_name': 'ProductClass'},
  164. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  165. 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
  166. 'options': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['catalogue.Option']", 'symmetrical': 'False', 'blank': 'True'}),
  167. 'requires_shipping': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
  168. 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '128'}),
  169. 'track_stock': ('django.db.models.fields.BooleanField', [], {'default': 'True'})
  170. },
  171. 'catalogue.productrecommendation': {
  172. 'Meta': {'object_name': 'ProductRecommendation'},
  173. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  174. 'primary': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'primary_recommendations'", 'to': "orm['catalogue.Product']"}),
  175. 'ranking': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '0'}),
  176. 'recommendation': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['catalogue.Product']"})
  177. },
  178. 'contenttypes.contenttype': {
  179. 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
  180. 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
  181. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  182. 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
  183. 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
  184. },
  185. 'wishlists.line': {
  186. 'Meta': {'unique_together': "(('wishlist', 'product'),)", 'object_name': 'Line'},
  187. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  188. 'product': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'wishlists_lines'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['catalogue.Product']"}),
  189. 'quantity': ('django.db.models.fields.PositiveIntegerField', [], {'default': '1'}),
  190. 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
  191. 'wishlist': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'lines'", 'to': "orm['wishlists.WishList']"})
  192. },
  193. 'wishlists.wishlist': {
  194. 'Meta': {'ordering': "('owner', 'date_created')", 'object_name': 'WishList'},
  195. 'date_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
  196. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  197. 'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '6', 'db_index': 'True'}),
  198. 'name': ('django.db.models.fields.CharField', [], {'default': "u'New Wish List'", 'max_length': '255'}),
  199. 'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'wishlists'", 'to': "orm['auth.User']"}),
  200. 'visibility': ('django.db.models.fields.CharField', [], {'default': "'Private'", 'max_length': '20'})
  201. }
  202. }
  203. complete_apps = ['wishlists']