Skip to content

Instantly share code, notes, and snippets.

@aronwoost
Created October 26, 2011 08:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aronwoost/1315807 to your computer and use it in GitHub Desktop.
Save aronwoost/1315807 to your computer and use it in GitHub Desktop.
dd
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Epub.date_published'
db.add_column('epubs_epub', 'date_published', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True), keep_default=False)
def backwards(self, orm):
# Deleting field 'Epub.date_published'
db.delete_column('epubs_epub', 'date_published')
models = {
'epubs.epub': {
'Meta': {'object_name': 'Epub'},
'author': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
'content_folder': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
'cover_image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'blank': 'True'}),
'date_published': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'identifier': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
'isbn': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '13'}),
'publisher': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['epubs.Publisher']"}),
'title': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
'toc': ('picklefield.fields.PickledObjectField', [], {})
},
'epubs.epubmetadata': {
'Meta': {'object_name': 'EpubMetadata'},
'date': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'epub': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['epubs.Epub']", 'unique': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'language': ('django.db.models.fields.CharField', [], {'max_length': '25', 'null': 'True', 'blank': 'True'}),
'publisher': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
'rights': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
'subject': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'})
},
'epubs.epubprice': {
'Meta': {'unique_together': "(('epub', 'currency', 'country_code'),)", 'object_name': 'EpubPrice'},
'amount': ('django.db.models.fields.DecimalField', [], {'max_digits': '10', 'decimal_places': '2'}),
'country_code': ('django.db.models.fields.CharField', [], {'max_length': '2'}),
'currency': ('django.db.models.fields.CharField', [], {'max_length': '10'}),
'epub': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['epubs.Epub']"}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
},
'epubs.publisher': {
'Meta': {'object_name': 'Publisher'},
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '255'})
}
}
complete_apps = ['epubs']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment