123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456 |
- # -*- coding: utf-8 -*-
- import datetime
- from south.db import db
- from south.v2 import DataMigration
- from django.db import models
- class Migration(DataMigration):
- def forwards(self, orm):
- "Write your forwards methods here."
- # copies all the data from short_description to subtitle
- for book in orm["catalog.book"].objects.all():
- book.subtitle = book.short_description
- book.save()
- def backwards(self, orm):
- "Write your backwards methods here."
- models = {
- "auth.group": {
- "Meta": {"object_name": "Group"},
- "id": ("django.db.models.fields.AutoField", [], {"primary_key": "True"}),
- "name": (
- "django.db.models.fields.CharField",
- [],
- {"unique": "True", "max_length": "80"},
- ),
- "permissions": (
- "django.db.models.fields.related.ManyToManyField",
- [],
- {
- "to": "orm['auth.Permission']",
- "symmetrical": "False",
- "blank": "True",
- },
- ),
- },
- "auth.permission": {
- "Meta": {
- "ordering": "('content_type__app_label', 'content_type__model', 'codename')",
- "unique_together": "(('content_type', 'codename'),)",
- "object_name": "Permission",
- },
- "codename": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "100"},
- ),
- "content_type": (
- "django.db.models.fields.related.ForeignKey",
- [],
- {"to": "orm['contenttypes.ContentType']"},
- ),
- "id": ("django.db.models.fields.AutoField", [], {"primary_key": "True"}),
- "name": ("django.db.models.fields.CharField", [], {"max_length": "50"}),
- },
- "auth.user": {
- "Meta": {"object_name": "User"},
- "date_joined": (
- "django.db.models.fields.DateTimeField",
- [],
- {"default": "datetime.datetime.now"},
- ),
- "email": (
- "django.db.models.fields.EmailField",
- [],
- {"max_length": "75", "blank": "True"},
- ),
- "first_name": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "30", "blank": "True"},
- ),
- "groups": (
- "django.db.models.fields.related.ManyToManyField",
- [],
- {"to": "orm['auth.Group']", "symmetrical": "False", "blank": "True"},
- ),
- "id": ("django.db.models.fields.AutoField", [], {"primary_key": "True"}),
- "is_active": (
- "django.db.models.fields.BooleanField",
- [],
- {"default": "True"},
- ),
- "is_staff": (
- "django.db.models.fields.BooleanField",
- [],
- {"default": "False"},
- ),
- "is_superuser": (
- "django.db.models.fields.BooleanField",
- [],
- {"default": "False"},
- ),
- "last_login": (
- "django.db.models.fields.DateTimeField",
- [],
- {"default": "datetime.datetime.now"},
- ),
- "last_name": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "30", "blank": "True"},
- ),
- "password": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "128"},
- ),
- "user_permissions": (
- "django.db.models.fields.related.ManyToManyField",
- [],
- {
- "to": "orm['auth.Permission']",
- "symmetrical": "False",
- "blank": "True",
- },
- ),
- "username": (
- "django.db.models.fields.CharField",
- [],
- {"unique": "True", "max_length": "30"},
- ),
- },
- "catalog.book": {
- "Meta": {"object_name": "Book", "_ormbases": ["catalog.Item"]},
- "author_image": (
- "sorl.thumbnail.fields.ImageField",
- [],
- {"max_length": "100", "null": "True", "blank": "True"},
- ),
- "authors": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "200", "null": "True", "blank": "True"},
- ),
- "dimensions": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "20", "null": "True", "blank": "True"},
- ),
- "edition": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "50", "null": "True", "blank": "True"},
- ),
- "editors": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "200", "null": "True", "blank": "True"},
- ),
- "features": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "100", "null": "True", "blank": "True"},
- ),
- "genre": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "100", "null": "True", "blank": "True"},
- ),
- "illustrator": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "200", "null": "True", "blank": "True"},
- ),
- "isbn": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "20", "null": "True", "blank": "True"},
- ),
- "item_ptr": (
- "django.db.models.fields.related.OneToOneField",
- [],
- {"to": "orm['catalog.Item']", "unique": "True", "primary_key": "True"},
- ),
- "library_of_congress_number": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "20", "null": "True", "blank": "True"},
- ),
- "pages": (
- "django.db.models.fields.IntegerField",
- [],
- {"null": "True", "blank": "True"},
- ),
- "printer": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "200", "null": "True", "blank": "True"},
- ),
- "publish_date": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "20", "null": "True", "blank": "True"},
- ),
- "publisher": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "200", "null": "True", "blank": "True"},
- ),
- "short_description": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "100", "null": "True", "blank": "True"},
- ),
- "subtitle": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "100", "null": "True", "blank": "True"},
- ),
- },
- "catalog.item": {
- "Meta": {"object_name": "Item"},
- "created": (
- "django.db.models.fields.DateTimeField",
- [],
- {"auto_now_add": "True", "blank": "True"},
- ),
- "created_by": (
- "django.db.models.fields.related.ForeignKey",
- [],
- {"related_name": "'+'", "to": "orm['auth.User']"},
- ),
- "deleted": (
- "django.db.models.fields.BooleanField",
- [],
- {"default": "False"},
- ),
- "description": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "200", "null": "True", "blank": "True"},
- ),
- "featured": (
- "django.db.models.fields.BooleanField",
- [],
- {"default": "False"},
- ),
- "id": ("django.db.models.fields.AutoField", [], {"primary_key": "True"}),
- "image": (
- "sorl.thumbnail.fields.ImageField",
- [],
- {"max_length": "100", "null": "True", "blank": "True"},
- ),
- "is_active": (
- "django.db.models.fields.BooleanField",
- [],
- {"default": "True"},
- ),
- "last_updated": (
- "django.db.models.fields.DateTimeField",
- [],
- {"auto_now": "True", "auto_now_add": "True", "blank": "True"},
- ),
- "last_updated_by": (
- "django.db.models.fields.related.ForeignKey",
- [],
- {"related_name": "'+'", "to": "orm['auth.User']"},
- ),
- "price": (
- "django.db.models.fields.DecimalField",
- [],
- {"max_digits": "7", "decimal_places": "2"},
- ),
- "shipping_cost": (
- "django.db.models.fields.DecimalField",
- [],
- {"max_digits": "7", "decimal_places": "2"},
- ),
- "shipping_cost_multiple": (
- "django.db.models.fields.DecimalField",
- [],
- {"max_digits": "7", "decimal_places": "2"},
- ),
- "sku": (
- "django.db.models.fields.SlugField",
- [],
- {"unique": "True", "max_length": "20"},
- ),
- "subclass_type": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "200"},
- ),
- "synopsis": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "200", "null": "True", "blank": "True"},
- ),
- "tax_free": (
- "django.db.models.fields.BooleanField",
- [],
- {"default": "False"},
- ),
- "title": ("django.db.models.fields.CharField", [], {"max_length": "50"}),
- },
- "catalog.map": {
- "Meta": {"object_name": "Map", "_ormbases": ["catalog.Item"]},
- "dimensions": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "20", "null": "True", "blank": "True"},
- ),
- "item_ptr": (
- "django.db.models.fields.related.OneToOneField",
- [],
- {"to": "orm['catalog.Item']", "unique": "True", "primary_key": "True"},
- ),
- },
- "catalog.movie": {
- "Meta": {"object_name": "Movie", "_ormbases": ["catalog.Item"]},
- "captioning": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "50", "null": "True", "blank": "True"},
- ),
- "format": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "20", "null": "True", "blank": "True"},
- ),
- "genre": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "100", "null": "True", "blank": "True"},
- ),
- "item_ptr": (
- "django.db.models.fields.related.OneToOneField",
- [],
- {"to": "orm['catalog.Item']", "unique": "True", "primary_key": "True"},
- ),
- "language": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "50", "null": "True", "blank": "True"},
- ),
- "music": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "200", "null": "True", "blank": "True"},
- ),
- "producer": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "200", "null": "True", "blank": "True"},
- ),
- "region": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "50", "null": "True", "blank": "True"},
- ),
- "runtime_minutes": (
- "django.db.models.fields.IntegerField",
- [],
- {"null": "True", "blank": "True"},
- ),
- "sound": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "50", "null": "True", "blank": "True"},
- ),
- },
- "catalog.subscription": {
- "Meta": {"object_name": "Subscription", "_ormbases": ["catalog.Item"]},
- "duration": ("django.db.models.fields.IntegerField", [], {}),
- "item_ptr": (
- "django.db.models.fields.related.OneToOneField",
- [],
- {"to": "orm['catalog.Item']", "unique": "True", "primary_key": "True"},
- ),
- "shipping_method": (
- "django.db.models.fields.CharField",
- [],
- {"default": "u'REGULAR'", "max_length": "20"},
- ),
- "shipping_type": (
- "django.db.models.fields.CharField",
- [],
- {"default": "'INSTATE'", "max_length": "10"},
- ),
- },
- "catalog.zipcode": {
- "Meta": {"object_name": "ZipCode"},
- "city": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "64", "null": "True", "blank": "True"},
- ),
- "county": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "64", "null": "True", "blank": "True"},
- ),
- "created": (
- "django.db.models.fields.DateTimeField",
- [],
- {"auto_now_add": "True", "blank": "True"},
- ),
- "created_by": (
- "django.db.models.fields.related.ForeignKey",
- [],
- {"related_name": "'+'", "to": "orm['auth.User']"},
- ),
- "deleted": (
- "django.db.models.fields.BooleanField",
- [],
- {"default": "False"},
- ),
- "id": ("django.db.models.fields.AutoField", [], {"primary_key": "True"}),
- "is_active": (
- "django.db.models.fields.BooleanField",
- [],
- {"default": "True"},
- ),
- "last_updated": (
- "django.db.models.fields.DateTimeField",
- [],
- {"auto_now": "True", "auto_now_add": "True", "blank": "True"},
- ),
- "last_updated_by": (
- "django.db.models.fields.related.ForeignKey",
- [],
- {"related_name": "'+'", "to": "orm['auth.User']"},
- ),
- "state": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "2", "null": "True", "blank": "True"},
- ),
- "zipcode": (
- "django.db.models.fields.CharField",
- [],
- {"unique": "True", "max_length": "9"},
- ),
- },
- "contenttypes.contenttype": {
- "Meta": {
- "ordering": "('name',)",
- "unique_together": "(('app_label', 'model'),)",
- "object_name": "ContentType",
- "db_table": "'django_content_type'",
- },
- "app_label": (
- "django.db.models.fields.CharField",
- [],
- {"max_length": "100"},
- ),
- "id": ("django.db.models.fields.AutoField", [], {"primary_key": "True"}),
- "model": ("django.db.models.fields.CharField", [], {"max_length": "100"}),
- "name": ("django.db.models.fields.CharField", [], {"max_length": "100"}),
- },
- }
- complete_apps = ["catalog"]
- symmetrical = True
|