/satchmo/apps/product/modules/configurable/migrations/0001_split.py

https://bitbucket.org/bookrepublic/satchmo · Python · 115 lines · 107 code · 7 blank · 1 comment · 0 complexity · 35e4e615af0231537151c48d5a96c0f1 MD5 · raw file

  1. # encoding: utf-8
  2. from south.db import db
  3. from south.v2 import SchemaMigration
  4. class Migration(SchemaMigration):
  5. depends_on = (
  6. ('product', '0010_add_discountable_categories'),
  7. )
  8. needed_by = (
  9. ('product', '0011_split_products'),
  10. )
  11. def forwards(self, orm):
  12. db.rename_table('product_configurableproduct', 'configurable_configurableproduct')
  13. db.rename_table('product_configurableproduct_option_group', 'configurable_configurableproduct_option_group')
  14. db.rename_table('product_productvariation', 'configurable_productvariation')
  15. db.rename_table('product_productvariation_options', 'configurable_productvariation_options')
  16. def backwards(self, orm):
  17. db.rename_table('configurable_configurableproduct', 'product_configurableproduct')
  18. db.rename_table('configurable_configurableproduct_option_group', 'product_configurableproduct_option_group')
  19. db.rename_table('configurable_productvariation', 'product_productvariation')
  20. db.rename_table('configurable_productvariation_options', 'product_productvariation_options')
  21. models = {
  22. 'configurable.configurableproduct': {
  23. 'Meta': {'object_name': 'ConfigurableProduct'},
  24. 'create_subs': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
  25. 'option_group': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['product.OptionGroup']", 'blank': 'True'}),
  26. 'product': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['product.Product']", 'unique': 'True', 'primary_key': 'True'})
  27. },
  28. 'configurable.productvariation': {
  29. 'Meta': {'object_name': 'ProductVariation'},
  30. 'options': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['product.Option']"}),
  31. 'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['configurable.ConfigurableProduct']"}),
  32. 'product': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['product.Product']", 'unique': 'True', 'primary_key': 'True'})
  33. },
  34. 'product.category': {
  35. 'Meta': {'unique_together': "(('site', 'slug'),)", 'object_name': 'Category'},
  36. 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
  37. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  38. 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
  39. 'meta': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
  40. 'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
  41. 'ordering': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
  42. 'parent': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'child'", 'blank': 'True', 'null': 'True', 'to': "orm['product.Category']"}),
  43. 'related_categories': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'related_categories'", 'blank': 'True', 'null': 'True', 'to': "orm['product.Category']"}),
  44. 'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}),
  45. 'slug': ('django.db.models.fields.SlugField', [], {'db_index': 'True', 'max_length': '50', 'blank': 'True'})
  46. },
  47. 'product.option': {
  48. 'Meta': {'unique_together': "(('option_group', 'value'),)", 'object_name': 'Option'},
  49. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  50. 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
  51. 'option_group': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['product.OptionGroup']"}),
  52. 'price_change': ('satchmo_utils.fields.CurrencyField', [], {'null': 'True', 'max_digits': '14', 'decimal_places': '6', 'blank': 'True'}),
  53. 'sort_order': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
  54. 'value': ('django.db.models.fields.CharField', [], {'max_length': '50'})
  55. },
  56. 'product.optiongroup': {
  57. 'Meta': {'object_name': 'OptionGroup'},
  58. 'description': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
  59. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  60. 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
  61. 'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}),
  62. 'sort_order': ('django.db.models.fields.IntegerField', [], {'default': '0'})
  63. },
  64. 'product.product': {
  65. 'Meta': {'unique_together': "(('site', 'sku'), ('site', 'slug'))", 'object_name': 'Product'},
  66. 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}),
  67. 'also_purchased': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'also_products'", 'blank': 'True', 'null': 'True', 'to': "orm['product.Product']"}),
  68. 'category': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['product.Category']", 'blank': 'True'}),
  69. 'date_added': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
  70. 'description': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}),
  71. 'featured': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
  72. 'height': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '6', 'decimal_places': '2', 'blank': 'True'}),
  73. 'height_units': ('django.db.models.fields.CharField', [], {'max_length': '3', 'null': 'True', 'blank': 'True'}),
  74. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  75. 'items_in_stock': ('django.db.models.fields.DecimalField', [], {'default': "'0'", 'max_digits': '18', 'decimal_places': '6'}),
  76. 'length': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '6', 'decimal_places': '2', 'blank': 'True'}),
  77. 'length_units': ('django.db.models.fields.CharField', [], {'max_length': '3', 'null': 'True', 'blank': 'True'}),
  78. 'meta': ('django.db.models.fields.TextField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
  79. 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
  80. 'ordering': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
  81. 'related_items': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'related_products'", 'blank': 'True', 'null': 'True', 'to': "orm['product.Product']"}),
  82. 'shipclass': ('django.db.models.fields.CharField', [], {'default': "'DEFAULT'", 'max_length': '10'}),
  83. 'short_description': ('django.db.models.fields.TextField', [], {'default': "''", 'max_length': '200', 'blank': 'True'}),
  84. 'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}),
  85. 'sku': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
  86. 'slug': ('django.db.models.fields.SlugField', [], {'db_index': 'True', 'max_length': '255', 'blank': 'True'}),
  87. 'taxClass': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['product.TaxClass']", 'null': 'True', 'blank': 'True'}),
  88. 'taxable': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
  89. 'total_sold': ('django.db.models.fields.DecimalField', [], {'default': "'0'", 'max_digits': '18', 'decimal_places': '6'}),
  90. 'weight': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '8', 'decimal_places': '2', 'blank': 'True'}),
  91. 'weight_units': ('django.db.models.fields.CharField', [], {'max_length': '3', 'null': 'True', 'blank': 'True'}),
  92. 'width': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '6', 'decimal_places': '2', 'blank': 'True'}),
  93. 'width_units': ('django.db.models.fields.CharField', [], {'max_length': '3', 'null': 'True', 'blank': 'True'})
  94. },
  95. 'product.taxclass': {
  96. 'Meta': {'object_name': 'TaxClass'},
  97. 'description': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
  98. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  99. 'title': ('django.db.models.fields.CharField', [], {'max_length': '20'})
  100. },
  101. 'sites.site': {
  102. 'Meta': {'object_name': 'Site', 'db_table': "'django_site'"},
  103. 'domain': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
  104. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  105. 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
  106. }
  107. }
  108. complete_apps = ['configurable']