Commits

Ruslan Keba committed 7b55fb4

initial models migration

Comments (0)

Files changed (3)

migrations/0001_initial.py

+# -*- 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 'Club'
+        db.create_table('djclub_club', (
+            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+            ('title', self.gf('django.db.models.fields.CharField')(max_length=50)),
+            ('is_default', self.gf('django.db.models.fields.BooleanField')(default=False)),
+        ))
+        db.send_create_signal('djclub', ['Club'])
+
+        # Adding model 'Event'
+        db.create_table('djclub_event', (
+            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+            ('club', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['djclub.Club'])),
+            ('title', self.gf('django.db.models.fields.CharField')(max_length=50)),
+            ('summary', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
+            ('markup', self.gf('django.db.models.fields.IntegerField')(default=0)),
+            ('important', self.gf('django.db.models.fields.BooleanField')(default=False)),
+            ('created', self.gf('django.db.models.fields.DateField')(auto_now_add=True, blank=True)),
+            ('date_begin', self.gf('django.db.models.fields.DateField')()),
+            ('date_end', self.gf('django.db.models.fields.DateField')(null=True, blank=True)),
+            ('poster_url', self.gf('django.db.models.fields.URLField')(max_length=200, null=True, blank=True)),
+            ('album_url', self.gf('django.db.models.fields.CharField')(max_length=100, null=True, blank=True)),
+            ('vkontakte_event', self.gf('django.db.models.fields.CharField')(max_length=50, null=True, blank=True)),
+        ))
+        db.send_create_signal('djclub', ['Event'])
+
+
+    def backwards(self, orm):
+        # Deleting model 'Club'
+        db.delete_table('djclub_club')
+
+        # Deleting model 'Event'
+        db.delete_table('djclub_event')
+
+
+    models = {
+        'djclub.club': {
+            'Meta': {'object_name': 'Club'},
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'is_default': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'title': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+        },
+        'djclub.event': {
+            'Meta': {'ordering': "('-date_begin',)", 'object_name': 'Event'},
+            'album_url': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+            'club': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['djclub.Club']"}),
+            'created': ('django.db.models.fields.DateField', [], {'auto_now_add': 'True', 'blank': 'True'}),
+            'date_begin': ('django.db.models.fields.DateField', [], {}),
+            'date_end': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'important': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'markup': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
+            'poster_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
+            'summary': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+            'title': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
+            'vkontakte_event': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'})
+        }
+    }
+
+    complete_apps = ['djclub']

migrations/__init__.py

Empty file added.
         (MARKUP_HTML, 'Raw HTML')
         )
 
-    club = models.ForeignKey(Club, default=Club.get_default)
+    club = models.ForeignKey(Club)
     title = models.CharField(max_length=50)
     summary = models.TextField(blank=True, null=True)
     markup = models.IntegerField(choices=MARKUP_CHOICES, default=MARKUP_GFM)