X-Git-Url: https://git.mdrn.pl/django-migdal.git/blobdiff_plain/734cd58d3f12c5397b42c1ae122c947500386014..d57965a38ccf06862015247092906eaa90fcfb5a:/migdal/migrations/0001_initial.py?ds=sidebyside
diff --git a/migdal/migrations/0001_initial.py b/migdal/migrations/0001_initial.py
index 3af9e00..781473a 100644
--- a/migdal/migrations/0001_initial.py
+++ b/migdal/migrations/0001_initial.py
@@ -1,130 +1,122 @@
# -*- coding: utf-8 -*-
-import datetime
-from south.db import db
-from south.v2 import SchemaMigration
-from django.db import models
+# Generated by Django 1.10.6 on 2017-03-29 09:51
+from __future__ import unicode_literals
+from django.db import migrations, models
+import django.db.models.deletion
+import markupfield.fields
+import migdal.fields
-class Migration(SchemaMigration):
- def forwards(self, orm):
- # Adding model 'Category'
- db.create_table('migdal_category', (
- ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
- ('slug_pl', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=50)),
- ('slug_en', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=50)),
- ('title_pl', self.gf('django.db.models.fields.CharField')(unique=True, max_length=64, db_index=True)),
- ('title_en', self.gf('django.db.models.fields.CharField')(unique=True, max_length=64, db_index=True)),
- ))
- db.send_create_signal('migdal', ['Category'])
+class Migration(migrations.Migration):
- # Adding model 'Entry'
- db.create_table('migdal_entry', (
- ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
- ('type', self.gf('django.db.models.fields.CharField')(max_length=16, db_index=True)),
- ('date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, db_index=True, blank=True)),
- ('author', self.gf('django.db.models.fields.CharField')(max_length=128)),
- ('author_email', self.gf('django.db.models.fields.EmailField')(max_length=128, null=True, blank=True)),
- ('image', self.gf('django.db.models.fields.files.ImageField')(max_length=100, null=True, blank=True)),
- ('promo', self.gf('django.db.models.fields.BooleanField')(default=False)),
- ('slug_pl', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=50)),
- ('title_pl', self.gf('django.db.models.fields.CharField')(max_length=255)),
- ('lead_pl', self.gf('markupfield.fields.MarkupField')(rendered_field=True)),
- ('lead_pl_markup_type', self.gf('django.db.models.fields.CharField')(default='textile_pl', max_length=30)),
- ('_lead_pl_rendered', self.gf('django.db.models.fields.TextField')()),
- ('slug_en', self.gf('django.db.models.fields.SlugField')(max_length=50, unique=True, null=True, blank=True)),
- ('title_en', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True)),
- ('lead_en', self.gf('markupfield.fields.MarkupField')(null=True, rendered_field=True, blank=True)),
- ('needed_en', self.gf('django.db.models.fields.CharField')(default='n', max_length=1, db_index=True)),
- ('lead_en_markup_type', self.gf('django.db.models.fields.CharField')(default='textile_pl', max_length=30, blank=True)),
- ('_lead_en_rendered', self.gf('django.db.models.fields.TextField')()),
- ('body_pl', self.gf('markupfield.fields.MarkupField')(null=True, rendered_field=True, blank=True)),
- ('body_en', self.gf('markupfield.fields.MarkupField')(null=True, rendered_field=True, blank=True)),
- ('body_pl_markup_type', self.gf('django.db.models.fields.CharField')(default='textile_pl', max_length=30, blank=True)),
- ('body_en_markup_type', self.gf('django.db.models.fields.CharField')(default='textile_pl', max_length=30, blank=True)),
- ('published_pl', self.gf('django.db.models.fields.BooleanField')(default=False)),
- ('published_en', self.gf('django.db.models.fields.BooleanField')(default=False)),
- ('_body_pl_rendered', self.gf('django.db.models.fields.TextField')()),
- ('_body_en_rendered', self.gf('django.db.models.fields.TextField')()),
- ))
- db.send_create_signal('migdal', ['Entry'])
+ initial = True
- # Adding M2M table for field categories on 'Entry'
- db.create_table('migdal_entry_categories', (
- ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
- ('entry', models.ForeignKey(orm['migdal.entry'], null=False)),
- ('category', models.ForeignKey(orm['migdal.category'], null=False))
- ))
- db.create_unique('migdal_entry_categories', ['entry_id', 'category_id'])
+ dependencies = [
+ ]
- # Adding model 'Attachment'
- db.create_table('migdal_attachment', (
- ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
- ('file', self.gf('django.db.models.fields.files.FileField')(max_length=100)),
- ('entry', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['migdal.Entry'])),
- ))
- db.send_create_signal('migdal', ['Attachment'])
-
-
- def backwards(self, orm):
- # Deleting model 'Category'
- db.delete_table('migdal_category')
-
- # Deleting model 'Entry'
- db.delete_table('migdal_entry')
-
- # Removing M2M table for field categories on 'Entry'
- db.delete_table('migdal_entry_categories')
-
- # Deleting model 'Attachment'
- db.delete_table('migdal_attachment')
-
-
- models = {
- 'migdal.attachment': {
- 'Meta': {'object_name': 'Attachment'},
- 'entry': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['migdal.Entry']"}),
- 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
- },
- 'migdal.category': {
- 'Meta': {'object_name': 'Category'},
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'slug_en': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}),
- 'slug_pl': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}),
- 'title_en': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64', 'db_index': 'True'}),
- 'title_pl': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64', 'db_index': 'True'})
- },
- 'migdal.entry': {
- 'Meta': {'ordering': "['-date']", 'object_name': 'Entry'},
- '_body_en_rendered': ('django.db.models.fields.TextField', [], {}),
- '_body_pl_rendered': ('django.db.models.fields.TextField', [], {}),
- '_lead_en_rendered': ('django.db.models.fields.TextField', [], {}),
- '_lead_pl_rendered': ('django.db.models.fields.TextField', [], {}),
- 'author': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
- 'author_email': ('django.db.models.fields.EmailField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
- 'body_en': ('markupfield.fields.MarkupField', [], {'null': 'True', 'rendered_field': 'True', 'blank': 'True'}),
- 'body_en_markup_type': ('django.db.models.fields.CharField', [], {'default': "'textile_pl'", 'max_length': '30', 'blank': 'True'}),
- 'body_pl': ('markupfield.fields.MarkupField', [], {'null': 'True', 'rendered_field': 'True', 'blank': 'True'}),
- 'body_pl_markup_type': ('django.db.models.fields.CharField', [], {'default': "'textile_pl'", 'max_length': '30', 'blank': 'True'}),
- 'categories': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['migdal.Category']", 'null': 'True', 'blank': 'True'}),
- 'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
- 'lead_en': ('markupfield.fields.MarkupField', [], {'null': 'True', 'rendered_field': 'True', 'blank': 'True'}),
- 'lead_en_markup_type': ('django.db.models.fields.CharField', [], {'default': "'textile_pl'", 'max_length': '30', 'blank': 'True'}),
- 'lead_pl': ('markupfield.fields.MarkupField', [], {'rendered_field': 'True'}),
- 'lead_pl_markup_type': ('django.db.models.fields.CharField', [], {'default': "'textile_pl'", 'max_length': '30'}),
- 'needed_en': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1', 'db_index': 'True'}),
- 'promo': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'published_en': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'published_pl': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'slug_en': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
- 'slug_pl': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}),
- 'title_en': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
- 'title_pl': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
- 'type': ('django.db.models.fields.CharField', [], {'max_length': '16', 'db_index': 'True'})
- }
- }
-
- complete_apps = ['migdal']
\ No newline at end of file
+ operations = [
+ migrations.CreateModel(
+ name='Attachment',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('file', models.FileField(upload_to=b'entry/attach/', verbose_name='file')),
+ ],
+ ),
+ migrations.CreateModel(
+ name='Category',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('taxonomy', models.CharField(choices=[(b'topics', 'topics'), (b'types', 'types')], max_length=32, verbose_name='taxonomy')),
+ ('title_pl', models.CharField(db_index=True, max_length=64, unique=True)),
+ ('title_en', models.CharField(db_index=True, max_length=64, unique=True)),
+ ('slug_pl', models.SlugField(unique=True)),
+ ('slug_en', models.SlugField(unique=True)),
+ ],
+ options={
+ 'verbose_name': 'category',
+ 'verbose_name_plural': 'categories',
+ },
+ ),
+ migrations.CreateModel(
+ name='Entry',
+ fields=[
+ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
+ ('type', models.CharField(choices=[(b'news', 'news'), (b'publications', 'publications'), (b'info', 'info')], db_index=True, max_length=16)),
+ ('date', models.DateTimeField(auto_now_add=True, db_index=True, verbose_name='created at')),
+ ('changed_at', models.DateTimeField(auto_now=True, db_index=True, verbose_name='changed at')),
+ ('author', models.CharField(max_length=128, verbose_name='author')),
+ ('author_email', models.EmailField(blank=True, help_text='Used only to display gravatar and send notifications.', max_length=128, null=True, verbose_name='author email')),
+ ('image', models.ImageField(blank=True, null=True, upload_to=b'entry/image/', verbose_name='image')),
+ ('promo', models.BooleanField(default=False, verbose_name='promoted')),
+ ('in_stream', models.BooleanField(default=True, verbose_name='in stream')),
+ ('first_published_at', models.DateTimeField(blank=True, null=True, verbose_name='published at')),
+ ('canonical_url', models.URLField(blank=True, null=True, verbose_name='canonical link')),
+ ('needed_en', models.CharField(choices=[(b'n', 'Unneeded'), (b'w', 'Needed'), (b'y', 'Done')], db_index=True, default=b'n', max_length=1, verbose_name='needed')),
+ ('slug_pl', migdal.fields.SlugNullField(blank=True, null=True, unique=True)),
+ ('slug_en', migdal.fields.SlugNullField(blank=True, null=True, unique=True)),
+ ('title_pl', models.CharField(blank=True, max_length=255, null=True, verbose_name='title')),
+ ('title_en', models.CharField(blank=True, max_length=255, null=True, verbose_name='title')),
+ ('lead_pl', markupfield.fields.MarkupField(blank=True, help_text='Use Textile syntax.', null=True, rendered_field=True, verbose_name='lead')),
+ ('lead_en', markupfield.fields.MarkupField(blank=True, help_text='Use Textile syntax.', null=True, rendered_field=True, verbose_name='lead')),
+ ('body_pl', markupfield.fields.MarkupField(blank=True, help_text='Use Textile syntax.', null=True, rendered_field=True, verbose_name='body')),
+ ('body_en', markupfield.fields.MarkupField(blank=True, help_text='Use Textile syntax.', null=True, rendered_field=True, verbose_name='body')),
+ ('lead_pl_markup_type', models.CharField(choices=[(b'', b'--'), (b'textile_pl', b'textile_pl')], default=b'textile_pl', editable=False, max_length=30)),
+ ('lead_en_markup_type', models.CharField(choices=[(b'', b'--'), (b'textile_pl', b'textile_pl')], default=b'textile_pl', editable=False, max_length=30)),
+ ('body_pl_markup_type', models.CharField(choices=[(b'', b'--'), (b'textile_pl', b'textile_pl')], default=b'textile_pl', editable=False, max_length=30)),
+ ('body_en_markup_type', models.CharField(choices=[(b'', b'--'), (b'textile_pl', b'textile_pl')], default=b'textile_pl', editable=False, max_length=30)),
+ ('_lead_pl_rendered', models.TextField(editable=False, null=True)),
+ ('_lead_en_rendered', models.TextField(editable=False, null=True)),
+ ('published_pl', models.BooleanField(default=False, verbose_name='published')),
+ ('published_en', models.BooleanField(default=False, verbose_name='published')),
+ ('_body_pl_rendered', models.TextField(editable=False, null=True)),
+ ('_body_en_rendered', models.TextField(editable=False, null=True)),
+ ('published_at_pl', models.DateTimeField(blank=True, null=True, verbose_name='published at')),
+ ('published_at_en', models.DateTimeField(blank=True, null=True, verbose_name='published at')),
+ ('categories', models.ManyToManyField(blank=True, to='migdal.Category', verbose_name='categories')),
+ ],
+ options={
+ 'ordering': ['-date'],
+ 'verbose_name': 'entry',
+ 'verbose_name_plural': 'entries',
+ },
+ ),
+ migrations.AddField(
+ model_name='attachment',
+ name='entry',
+ field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='migdal.Entry'),
+ ),
+ migrations.CreateModel(
+ name='Entry_info',
+ fields=[
+ ],
+ options={
+ 'verbose_name': 'entry: info',
+ 'proxy': True,
+ 'verbose_name_plural': 'entries: info',
+ },
+ bases=('migdal.entry',),
+ ),
+ migrations.CreateModel(
+ name='Entry_news',
+ fields=[
+ ],
+ options={
+ 'verbose_name': 'entry: news',
+ 'proxy': True,
+ 'verbose_name_plural': 'entries: news',
+ },
+ bases=('migdal.entry',),
+ ),
+ migrations.CreateModel(
+ name='Entry_publications',
+ fields=[
+ ],
+ options={
+ 'verbose_name': 'entry: publications',
+ 'proxy': True,
+ 'verbose_name_plural': 'entries: publications',
+ },
+ bases=('migdal.entry',),
+ ),
+ ]