X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/bc7619edc01175ed32c2155a19fba22ddb8365ce..4b4e3aa4d7f75f4bee66b3f3098cbeb756adb8d0:/apps/libraries/migrations/0001_initial.py?ds=inline diff --git a/apps/libraries/migrations/0001_initial.py b/apps/libraries/migrations/0001_initial.py index 0411c878a..4b210f8b7 100644 --- a/apps/libraries/migrations/0001_initial.py +++ b/apps/libraries/migrations/0001_initial.py @@ -1,36 +1,43 @@ # -*- 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 'Library' - db.create_table(u'libraries_library', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('name', self.gf('django.db.models.fields.CharField')(max_length=120, blank=True)), - ('url', self.gf('django.db.models.fields.CharField')(max_length=120, blank=True)), - ('description', self.gf('django.db.models.fields.TextField')(blank=True)), - )) - db.send_create_signal(u'libraries', ['Library']) - - - def backwards(self, orm): - # Deleting model 'Library' - db.delete_table(u'libraries_library') - - - models = { - u'libraries.library': { - 'Meta': {'object_name': 'Library'}, - 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'name': ('django.db.models.fields.CharField', [], {'max_length': '120', 'blank': 'True'}), - 'url': ('django.db.models.fields.CharField', [], {'max_length': '120', 'blank': 'True'}) - } - } - - complete_apps = ['libraries'] \ No newline at end of file +from __future__ import unicode_literals + +from django.db import models, migrations +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Catalog', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('name', models.CharField(max_length=120, verbose_name='name')), + ('slug', models.SlugField(unique=True, max_length=120, verbose_name='Slug')), + ], + options={ + 'verbose_name': 'catalog', + 'verbose_name_plural': 'catalogs', + }, + bases=(models.Model,), + ), + migrations.CreateModel( + name='Library', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('name', models.CharField(max_length=120, verbose_name='name', blank=True)), + ('slug', models.SlugField(max_length=120, unique=True, null=True, verbose_name='Slug')), + ('url', models.CharField(max_length=120, verbose_name='url', blank=True)), + ('description', models.TextField(verbose_name='Description', blank=True)), + ('catalog', models.ForeignKey(related_name=b'libraries', on_delete=django.db.models.deletion.PROTECT, to='libraries.Catalog')), + ], + options={ + 'verbose_name': 'library', + 'verbose_name_plural': 'libraries', + }, + bases=(models.Model,), + ), + ]