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.

0003_auto.py 5.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 M2M table for field countries on 'OrderAndItemCharges'
  9. db.create_table('shipping_orderanditemcharges_countries', (
  10. ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
  11. ('orderanditemcharges', models.ForeignKey(orm['shipping.orderanditemcharges'], null=False)),
  12. ('country', models.ForeignKey(orm['address.country'], null=False))
  13. ))
  14. db.create_unique('shipping_orderanditemcharges_countries', ['orderanditemcharges_id', 'country_id'])
  15. # Adding M2M table for field countries on 'WeightBased'
  16. db.create_table('shipping_weightbased_countries', (
  17. ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
  18. ('weightbased', models.ForeignKey(orm['shipping.weightbased'], null=False)),
  19. ('country', models.ForeignKey(orm['address.country'], null=False))
  20. ))
  21. db.create_unique('shipping_weightbased_countries', ['weightbased_id', 'country_id'])
  22. def backwards(self, orm):
  23. # Removing M2M table for field countries on 'OrderAndItemCharges'
  24. db.delete_table('shipping_orderanditemcharges_countries')
  25. # Removing M2M table for field countries on 'WeightBased'
  26. db.delete_table('shipping_weightbased_countries')
  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. 'shipping.orderanditemcharges': {
  39. 'Meta': {'object_name': 'OrderAndItemCharges'},
  40. 'code': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '128'}),
  41. 'countries': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['address.Country']", 'null': 'True', 'blank': 'True'}),
  42. 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
  43. 'free_shipping_threshold': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '12', 'decimal_places': '2', 'blank': 'True'}),
  44. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  45. 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}),
  46. 'price_per_item': ('django.db.models.fields.DecimalField', [], {'default': "'0.00'", 'max_digits': '12', 'decimal_places': '2'}),
  47. 'price_per_order': ('django.db.models.fields.DecimalField', [], {'default': "'0.00'", 'max_digits': '12', 'decimal_places': '2'})
  48. },
  49. 'shipping.weightband': {
  50. 'Meta': {'ordering': "['upper_limit']", 'object_name': 'WeightBand'},
  51. 'charge': ('django.db.models.fields.DecimalField', [], {'max_digits': '12', 'decimal_places': '2'}),
  52. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  53. 'method': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'bands'", 'to': "orm['shipping.WeightBased']"}),
  54. 'upper_limit': ('django.db.models.fields.FloatField', [], {})
  55. },
  56. 'shipping.weightbased': {
  57. 'Meta': {'object_name': 'WeightBased'},
  58. 'code': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '128'}),
  59. 'countries': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['address.Country']", 'null': 'True', 'blank': 'True'}),
  60. 'default_weight': ('django.db.models.fields.DecimalField', [], {'default': "'0.00'", 'max_digits': '12', 'decimal_places': '2'}),
  61. 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
  62. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  63. 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}),
  64. 'upper_charge': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '12', 'decimal_places': '2'})
  65. }
  66. }
  67. complete_apps = ['shipping']