Fix sponsors initial migration.
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Fri, 14 Jun 2013 11:09:13 +0000 (13:09 +0200)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Fri, 14 Jun 2013 11:09:13 +0000 (13:09 +0200)
apps/sponsors/migrations/0001_initial.py
apps/sponsors/models.py

index 6406595..5233db3 100644 (file)
@@ -1,60 +1,59 @@
-# encoding: utf-8
+# -*- coding: utf-8 -*-
 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 model 'Sponsor'
-        db.create_table('sponsors_sponsor', (
-            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+        db.create_table(u'sponsors_sponsor', (
+            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
             ('name', self.gf('django.db.models.fields.CharField')(max_length=120)),
             ('_description', self.gf('django.db.models.fields.CharField')(max_length=255, blank=True)),
             ('logo', self.gf('django.db.models.fields.files.ImageField')(max_length=100)),
             ('url', self.gf('django.db.models.fields.URLField')(max_length=200, blank=True)),
         ))
-        db.send_create_signal('sponsors', ['Sponsor'])
+        db.send_create_signal(u'sponsors', ['Sponsor'])
 
         # Adding model 'SponsorPage'
-        db.create_table('sponsors_sponsorpage', (
-            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+        db.create_table(u'sponsors_sponsorpage', (
+            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
             ('name', self.gf('django.db.models.fields.CharField')(max_length=120)),
-            ('sponsors', self.gf('jsonfield.fields.JSONField')(default={})),
+            ('sponsors', self.gf('jsonfield.fields.JSONField')(default='{}')),
             ('_html', self.gf('django.db.models.fields.TextField')(blank=True)),
             ('sprite', self.gf('django.db.models.fields.files.ImageField')(max_length=100, blank=True)),
         ))
-        db.send_create_signal('sponsors', ['SponsorPage'])
+        db.send_create_signal(u'sponsors', ['SponsorPage'])
 
 
     def backwards(self, orm):
-        
         # Deleting model 'Sponsor'
-        db.delete_table('sponsors_sponsor')
+        db.delete_table(u'sponsors_sponsor')
 
         # Deleting model 'SponsorPage'
-        db.delete_table('sponsors_sponsorpage')
+        db.delete_table(u'sponsors_sponsorpage')
 
 
     models = {
-        'sponsors.sponsor': {
+        u'sponsors.sponsor': {
             'Meta': {'object_name': 'Sponsor'},
             '_description': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
             'logo': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}),
             'name': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
             'url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'blank': 'True'})
         },
-        'sponsors.sponsorpage': {
+        u'sponsors.sponsorpage': {
             'Meta': {'object_name': 'SponsorPage'},
             '_html': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
-            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
             'name': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
-            'sponsors': ('jsonfield.fields.JSONField', [], {'default': '{}'}),
+            'sponsors': ('jsonfield.fields.JSONField', [], {'default': "'{}'"}),
             'sprite': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'blank': 'True'})
         }
     }
 
-    complete_apps = ['sponsors']
+    complete_apps = ['sponsors']
\ No newline at end of file
index cbc8d9b..2d18d16 100644 (file)
@@ -35,7 +35,7 @@ class Sponsor(models.Model):
 
 class SponsorPage(models.Model):
     name = models.CharField(_('name'), max_length=120)
-    sponsors = JSONField(_('sponsors'), default={})
+    sponsors = JSONField(_('sponsors'), default='{}')
     _html = models.TextField(blank=True, editable=False)
     sprite = models.ImageField(upload_to='sponsorzy/sprite', blank=True)