From 5c829e2af35b965c68a66820148618884b6c2e14 Mon Sep 17 00:00:00 2001 From: Will Barton Date: Mon, 11 Apr 2016 13:10:00 -0400 Subject: [PATCH 1/6] Switch from South to Django migrations and bump to Django 1.8 --- README.md | 2 +- regcore/fields.py | 7 +- regcore/migrations/0001_initial.py | 233 +++++++----------- ...chg_field_layer_layer__chg_field_regula.py | 76 ------ regcore/migrations/0003_index_charset.py | 86 ------- .../0004_auto__add_field_regulation_root.py | 61 ----- regcore/migrations/0005_set_root_regs.py | 60 ----- ...ique_noticecfrpart_notice_cfr_part__add.py | 82 ------ regcore/migrations/0007_multiple_cfr_parts.py | 72 ------ .../0008_auto__del_field_notice_cfr_part.py | 66 ----- .../0009_auto__add_field_regulation_marker.py | 67 ----- ...g_field_regulation_label_string__chg_fi.py | 77 ------ ...to__chg_field_layer_label__chg_field_re.py | 78 ------ ..._newnotice_document_number_cfr_part__ad.py | 96 -------- regcore/migrations/0013_new_notice.py | 106 -------- ...part__del_unique_noticecfrpart_notice_c.py | 91 ------- ..._newnotice_document_number_cfr_part__de.py | 85 ------- regcore/settings/base.py | 1 - requirements.txt | 2 +- 19 files changed, 97 insertions(+), 1251 deletions(-) delete mode 100644 regcore/migrations/0002_auto__chg_field_notice_notice__chg_field_layer_layer__chg_field_regula.py delete mode 100644 regcore/migrations/0003_index_charset.py delete mode 100644 regcore/migrations/0004_auto__add_field_regulation_root.py delete mode 100644 regcore/migrations/0005_set_root_regs.py delete mode 100644 regcore/migrations/0006_auto__add_noticecfrpart__add_unique_noticecfrpart_notice_cfr_part__add.py delete mode 100644 regcore/migrations/0007_multiple_cfr_parts.py delete mode 100644 regcore/migrations/0008_auto__del_field_notice_cfr_part.py delete mode 100644 regcore/migrations/0009_auto__add_field_regulation_marker.py delete mode 100644 regcore/migrations/0010_auto__chg_field_layer_label__chg_field_regulation_label_string__chg_fi.py delete mode 100644 regcore/migrations/0011_auto__chg_field_layer_label__chg_field_re.py delete mode 100644 regcore/migrations/0012_auto__add_newnotice__add_unique_newnotice_document_number_cfr_part__ad.py delete mode 100644 regcore/migrations/0013_new_notice.py delete mode 100644 regcore/migrations/0014_auto__del_notice__del_noticecfrpart__del_unique_noticecfrpart_notice_c.py delete mode 100644 regcore/migrations/0015_auto__del_newnotice__del_unique_newnotice_document_number_cfr_part__de.py diff --git a/README.md b/README.md index 239c363..3248131 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ $ pip install -r requirements_dev.txt # helpful modules for developers With that, you just need a few additional commands to get up and running: ```bash -$ python manage.py syncdb --migrate +$ python manage.py migrate $ python manage.py runserver ``` diff --git a/regcore/fields.py b/regcore/fields.py index af2e0fd..be2cad0 100644 --- a/regcore/fields.py +++ b/regcore/fields.py @@ -4,7 +4,6 @@ from django.db import models from django.db.models.fields.subclassing import Creator -from south.modelsinspector import add_introspection_rules class PatchedSubFieldBase(type): @@ -73,5 +72,7 @@ def __get__(self, instance, instance_type=None): if instance is None: return self - -add_introspection_rules([], ["^regcore\.fields\.CompressedJSONField"]) + def deconstruct(self): + name, path, args, kwargs = super( + CompressedJSONField, self).deconstruct() + return name, path, args, kwargs diff --git a/regcore/migrations/0001_initial.py b/regcore/migrations/0001_initial.py index 07e4668..7772805 100644 --- a/regcore/migrations/0001_initial.py +++ b/regcore/migrations/0001_initial.py @@ -1,143 +1,92 @@ # -*- 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 'Regulation' - db.create_table(u'regcore_regulation', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('version', self.gf('django.db.models.fields.SlugField')(max_length=20)), - ('label_string', self.gf('django.db.models.fields.SlugField')(max_length=50)), - ('text', self.gf('django.db.models.fields.TextField')()), - ('title', self.gf('django.db.models.fields.TextField')(blank=True)), - ('node_type', self.gf('django.db.models.fields.SlugField')(max_length=10)), - ('children', self.gf('django.db.models.fields.TextField')()), - )) - db.send_create_signal(u'regcore', ['Regulation']) - - # Adding unique constraint on 'Regulation', fields ['version', 'label_string'] - db.create_unique(u'regcore_regulation', ['version', 'label_string']) - - # Adding index on 'Regulation', fields ['version', 'label_string'] - db.create_index(u'regcore_regulation', ['version', 'label_string']) - - # Adding model 'Layer' - db.create_table(u'regcore_layer', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('version', self.gf('django.db.models.fields.SlugField')(max_length=20)), - ('name', self.gf('django.db.models.fields.SlugField')(max_length=20)), - ('label', self.gf('django.db.models.fields.SlugField')(max_length=50)), - ('layer', self.gf('django.db.models.fields.TextField')()), - )) - db.send_create_signal(u'regcore', ['Layer']) - - # Adding unique constraint on 'Layer', fields ['version', 'name', 'label'] - db.create_unique(u'regcore_layer', ['version', 'name', 'label']) - - # Adding index on 'Layer', fields ['version', 'name', 'label'] - db.create_index(u'regcore_layer', ['version', 'name', 'label']) - - # Adding model 'Notice' - db.create_table(u'regcore_notice', ( - ('document_number', self.gf('django.db.models.fields.SlugField')(max_length=20, primary_key=True)), - ('effective_on', self.gf('django.db.models.fields.DateField')(null=True)), - ('fr_url', self.gf('django.db.models.fields.CharField')(max_length=200)), - ('publication_date', self.gf('django.db.models.fields.DateField')()), - ('notice', self.gf('django.db.models.fields.TextField')()), - ('cfr_part', self.gf('django.db.models.fields.SlugField')(max_length=10)), - )) - db.send_create_signal(u'regcore', ['Notice']) - - # Adding model 'Diff' - db.create_table(u'regcore_diff', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('label', self.gf('django.db.models.fields.SlugField')(max_length=50)), - ('old_version', self.gf('django.db.models.fields.SlugField')(max_length=20)), - ('new_version', self.gf('django.db.models.fields.SlugField')(max_length=20)), - ('diff', self.gf('django.db.models.fields.TextField')()), - )) - db.send_create_signal(u'regcore', ['Diff']) - - # Adding unique constraint on 'Diff', fields ['label', 'old_version', 'new_version'] - db.create_unique(u'regcore_diff', ['label', 'old_version', 'new_version']) - - # Adding index on 'Diff', fields ['label', 'old_version', 'new_version'] - db.create_index(u'regcore_diff', ['label', 'old_version', 'new_version']) - - - def backwards(self, orm): - # Removing index on 'Diff', fields ['label', 'old_version', 'new_version'] - db.delete_index(u'regcore_diff', ['label', 'old_version', 'new_version']) - - # Removing unique constraint on 'Diff', fields ['label', 'old_version', 'new_version'] - db.delete_unique(u'regcore_diff', ['label', 'old_version', 'new_version']) - - # Removing index on 'Layer', fields ['version', 'name', 'label'] - db.delete_index(u'regcore_layer', ['version', 'name', 'label']) - - # Removing unique constraint on 'Layer', fields ['version', 'name', 'label'] - db.delete_unique(u'regcore_layer', ['version', 'name', 'label']) - - # Removing index on 'Regulation', fields ['version', 'label_string'] - db.delete_index(u'regcore_regulation', ['version', 'label_string']) - - # Removing unique constraint on 'Regulation', fields ['version', 'label_string'] - db.delete_unique(u'regcore_regulation', ['version', 'label_string']) - - # Deleting model 'Regulation' - db.delete_table(u'regcore_regulation') - - # Deleting model 'Layer' - db.delete_table(u'regcore_layer') - - # Deleting model 'Notice' - db.delete_table(u'regcore_notice') - - # Deleting model 'Diff' - db.delete_table(u'regcore_diff') - - - models = { - u'regcore.diff': { - 'Meta': {'unique_together': "(('label', 'old_version', 'new_version'),)", 'object_name': 'Diff', 'index_together': "(('label', 'old_version', 'new_version'),)"}, - 'diff': ('django.db.models.fields.TextField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'new_version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'old_version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - }, - u'regcore.layer': { - 'Meta': {'unique_together': "(('version', 'name', 'label'),)", 'object_name': 'Layer', 'index_together': "(('version', 'name', 'label'),)"}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'layer': ('django.db.models.fields.TextField', [], {}), - 'name': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - }, - u'regcore.notice': { - 'Meta': {'object_name': 'Notice'}, - 'cfr_part': ('django.db.models.fields.SlugField', [], {'max_length': '10'}), - 'document_number': ('django.db.models.fields.SlugField', [], {'max_length': '20', 'primary_key': 'True'}), - 'effective_on': ('django.db.models.fields.DateField', [], {'null': 'True'}), - 'fr_url': ('django.db.models.fields.CharField', [], {'max_length': '200'}), - 'notice': ('django.db.models.fields.TextField', [], {}), - 'publication_date': ('django.db.models.fields.DateField', [], {}) - }, - u'regcore.regulation': { - 'Meta': {'unique_together': "(('version', 'label_string'),)", 'object_name': 'Regulation', 'index_together': "(('version', 'label_string'),)"}, - 'children': ('django.db.models.fields.TextField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label_string': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'node_type': ('django.db.models.fields.SlugField', [], {'max_length': '10'}), - 'text': ('django.db.models.fields.TextField', [], {}), - 'title': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - } - } - - complete_apps = ['regcore'] \ No newline at end of file +from __future__ import unicode_literals + +from django.db import models, migrations +import regcore.fields + + +class Migration(migrations.Migration): + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Diff', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('label', models.SlugField(max_length=200)), + ('old_version', models.SlugField(max_length=20)), + ('new_version', models.SlugField(max_length=20)), + ('diff', regcore.fields.CompressedJSONField()), + ], + ), + migrations.CreateModel( + name='Layer', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('version', models.SlugField(max_length=20)), + ('name', models.SlugField(max_length=20)), + ('label', models.SlugField(max_length=200)), + ('layer', regcore.fields.CompressedJSONField()), + ], + ), + migrations.CreateModel( + name='Notice', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('document_number', models.SlugField(max_length=20)), + ('cfr_part', models.SlugField(max_length=200)), + ('effective_on', models.DateField(null=True)), + ('fr_url', models.CharField(max_length=200)), + ('publication_date', models.DateField()), + ('notice', regcore.fields.CompressedJSONField()), + ], + ), + migrations.CreateModel( + name='Regulation', + fields=[ + ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), + ('version', models.SlugField(max_length=20)), + ('label_string', models.SlugField(max_length=200)), + ('text', models.TextField()), + ('title', models.TextField(blank=True)), + ('node_type', models.SlugField(max_length=10)), + ('children', regcore.fields.CompressedJSONField()), + ('root', models.BooleanField(default=False, db_index=True)), + ('marker', models.CharField(default=b'', max_length=10)), + ], + ), + migrations.AlterUniqueTogether( + name='regulation', + unique_together=set([('version', 'label_string')]), + ), + migrations.AlterIndexTogether( + name='regulation', + index_together=set([('version', 'label_string')]), + ), + migrations.AlterUniqueTogether( + name='notice', + unique_together=set([('document_number', 'cfr_part')]), + ), + migrations.AlterIndexTogether( + name='notice', + index_together=set([('document_number', 'cfr_part')]), + ), + migrations.AlterUniqueTogether( + name='layer', + unique_together=set([('version', 'name', 'label')]), + ), + migrations.AlterIndexTogether( + name='layer', + index_together=set([('version', 'name', 'label')]), + ), + migrations.AlterUniqueTogether( + name='diff', + unique_together=set([('label', 'old_version', 'new_version')]), + ), + migrations.AlterIndexTogether( + name='diff', + index_together=set([('label', 'old_version', 'new_version')]), + ), + ] diff --git a/regcore/migrations/0002_auto__chg_field_notice_notice__chg_field_layer_layer__chg_field_regula.py b/regcore/migrations/0002_auto__chg_field_notice_notice__chg_field_layer_layer__chg_field_regula.py deleted file mode 100644 index f80661c..0000000 --- a/regcore/migrations/0002_auto__chg_field_notice_notice__chg_field_layer_layer__chg_field_regula.py +++ /dev/null @@ -1,76 +0,0 @@ -# -*- 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): - - # Changing field 'Notice.notice' - db.alter_column(u'regcore_notice', 'notice', self.gf('regcore.fields.CompressedJSONField')()) - - # Changing field 'Layer.layer' - db.alter_column(u'regcore_layer', 'layer', self.gf('regcore.fields.CompressedJSONField')()) - - # Changing field 'Regulation.children' - db.alter_column(u'regcore_regulation', 'children', self.gf('regcore.fields.CompressedJSONField')()) - - # Changing field 'Diff.diff' - db.alter_column(u'regcore_diff', 'diff', self.gf('regcore.fields.CompressedJSONField')()) - - def backwards(self, orm): - - # Changing field 'Notice.notice' - db.alter_column(u'regcore_notice', 'notice', self.gf('django.db.models.fields.TextField')()) - - # Changing field 'Layer.layer' - db.alter_column(u'regcore_layer', 'layer', self.gf('django.db.models.fields.TextField')()) - - # Changing field 'Regulation.children' - db.alter_column(u'regcore_regulation', 'children', self.gf('django.db.models.fields.TextField')()) - - # Changing field 'Diff.diff' - db.alter_column(u'regcore_diff', 'diff', self.gf('django.db.models.fields.TextField')()) - - models = { - u'regcore.diff': { - 'Meta': {'unique_together': "(('label', 'old_version', 'new_version'),)", 'object_name': 'Diff', 'index_together': "(('label', 'old_version', 'new_version'),)"}, - 'diff': ('regcore.fields.CompressedJSONField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'new_version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'old_version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - }, - u'regcore.layer': { - 'Meta': {'unique_together': "(('version', 'name', 'label'),)", 'object_name': 'Layer', 'index_together': "(('version', 'name', 'label'),)"}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'layer': ('regcore.fields.CompressedJSONField', [], {}), - 'name': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - }, - u'regcore.notice': { - 'Meta': {'object_name': 'Notice'}, - 'cfr_part': ('django.db.models.fields.SlugField', [], {'max_length': '10'}), - 'document_number': ('django.db.models.fields.SlugField', [], {'max_length': '20', 'primary_key': 'True'}), - 'effective_on': ('django.db.models.fields.DateField', [], {'null': 'True'}), - 'fr_url': ('django.db.models.fields.CharField', [], {'max_length': '200'}), - 'notice': ('regcore.fields.CompressedJSONField', [], {}), - 'publication_date': ('django.db.models.fields.DateField', [], {}) - }, - u'regcore.regulation': { - 'Meta': {'unique_together': "(('version', 'label_string'),)", 'object_name': 'Regulation', 'index_together': "(('version', 'label_string'),)"}, - 'children': ('regcore.fields.CompressedJSONField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label_string': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'node_type': ('django.db.models.fields.SlugField', [], {'max_length': '10'}), - 'text': ('django.db.models.fields.TextField', [], {}), - 'title': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - } - } - - complete_apps = ['regcore'] diff --git a/regcore/migrations/0003_index_charset.py b/regcore/migrations/0003_index_charset.py deleted file mode 100644 index 230ff53..0000000 --- a/regcore/migrations/0003_index_charset.py +++ /dev/null @@ -1,86 +0,0 @@ -# -*- coding: utf-8 -*- -import datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - """The purpose of this migration is to enforce the correct character set - and collation in mysql databases. We need utf8 to encode certain, - non-latin characters and we need a case-sensitive collation so that we - might have both 1005-A-b and 1005-A-B.""" - - def _longtext(self, table, field): - sql = ('ALTER TABLE regcore_%s MODIFY %s LONGTEXT ' - + 'CHARACTER SET utf8 COLLATE utf8_bin') - db.execute(sql % (table, field)) - - def _varchar(self, table, field, length): - sql = ('ALTER TABLE regcore_%s MODIFY %s VARCHAR(%d) ' - + 'CHARACTER SET utf8 COLLATE utf8_bin') - db.execute(sql % (table, field, length)) - - def forwards(self, orm): - if db.backend_name == 'mysql': - table = 'diff' - self._varchar(table, 'old_version', 20) - self._varchar(table, 'new_version', 20) - self._varchar(table, 'label', 50) - self._longtext(table, 'diff') - - table = 'layer' - self._varchar(table, 'version', 20) - self._varchar(table, 'name', 20) - self._varchar(table, 'label', 50) - self._longtext(table, 'layer') - - table = 'notice' - self._longtext(table, 'notice') - - table = 'regulation' - self._varchar(table, 'version', 20) - self._varchar(table, 'label_string', 50) - self._longtext(table, 'text') - self._longtext(table, 'title') - self._longtext(table, 'children') - - models = { - u'regcore.diff': { - 'Meta': {'unique_together': "(('label', 'old_version', 'new_version'),)", 'object_name': 'Diff', 'index_together': "(('label', 'old_version', 'new_version'),)"}, - 'diff': ('regcore.fields.CompressedJSONField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'new_version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'old_version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - }, - u'regcore.layer': { - 'Meta': {'unique_together': "(('version', 'name', 'label'),)", 'object_name': 'Layer', 'index_together': "(('version', 'name', 'label'),)"}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'layer': ('regcore.fields.CompressedJSONField', [], {}), - 'name': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - }, - u'regcore.notice': { - 'Meta': {'object_name': 'Notice'}, - 'cfr_part': ('django.db.models.fields.SlugField', [], {'max_length': '10'}), - 'document_number': ('django.db.models.fields.SlugField', [], {'max_length': '20', 'primary_key': 'True'}), - 'effective_on': ('django.db.models.fields.DateField', [], {'null': 'True'}), - 'fr_url': ('django.db.models.fields.CharField', [], {'max_length': '200'}), - 'notice': ('regcore.fields.CompressedJSONField', [], {}), - 'publication_date': ('django.db.models.fields.DateField', [], {}) - }, - u'regcore.regulation': { - 'Meta': {'unique_together': "(('version', 'label_string'),)", 'object_name': 'Regulation', 'index_together': "(('version', 'label_string'),)"}, - 'children': ('regcore.fields.CompressedJSONField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label_string': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'node_type': ('django.db.models.fields.SlugField', [], {'max_length': '10'}), - 'text': ('django.db.models.fields.TextField', [], {}), - 'title': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - } - } - - complete_apps = ['regcore'] diff --git a/regcore/migrations/0004_auto__add_field_regulation_root.py b/regcore/migrations/0004_auto__add_field_regulation_root.py deleted file mode 100644 index a857cab..0000000 --- a/regcore/migrations/0004_auto__add_field_regulation_root.py +++ /dev/null @@ -1,61 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as 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 'Regulation.root' - db.add_column(u'regcore_regulation', 'root', - self.gf('django.db.models.fields.BooleanField')(default=False, db_index=True), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'Regulation.root' - db.delete_column(u'regcore_regulation', 'root') - - - models = { - u'regcore.diff': { - 'Meta': {'unique_together': "(('label', 'old_version', 'new_version'),)", 'object_name': 'Diff', 'index_together': "(('label', 'old_version', 'new_version'),)"}, - 'diff': ('regcore.fields.CompressedJSONField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'new_version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'old_version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - }, - u'regcore.layer': { - 'Meta': {'unique_together': "(('version', 'name', 'label'),)", 'object_name': 'Layer', 'index_together': "(('version', 'name', 'label'),)"}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'layer': ('regcore.fields.CompressedJSONField', [], {}), - 'name': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - }, - u'regcore.notice': { - 'Meta': {'object_name': 'Notice'}, - 'cfr_part': ('django.db.models.fields.SlugField', [], {'max_length': '10'}), - 'document_number': ('django.db.models.fields.SlugField', [], {'max_length': '20', 'primary_key': 'True'}), - 'effective_on': ('django.db.models.fields.DateField', [], {'null': 'True'}), - 'fr_url': ('django.db.models.fields.CharField', [], {'max_length': '200'}), - 'notice': ('regcore.fields.CompressedJSONField', [], {}), - 'publication_date': ('django.db.models.fields.DateField', [], {}) - }, - u'regcore.regulation': { - 'Meta': {'unique_together': "(('version', 'label_string'),)", 'object_name': 'Regulation', 'index_together': "(('version', 'label_string'),)"}, - 'children': ('regcore.fields.CompressedJSONField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label_string': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'node_type': ('django.db.models.fields.SlugField', [], {'max_length': '10'}), - 'root': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), - 'text': ('django.db.models.fields.TextField', [], {}), - 'title': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - } - } - - complete_apps = ['regcore'] \ No newline at end of file diff --git a/regcore/migrations/0005_set_root_regs.py b/regcore/migrations/0005_set_root_regs.py deleted file mode 100644 index b41cdaf..0000000 --- a/regcore/migrations/0005_set_root_regs.py +++ /dev/null @@ -1,60 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import DataMigration -from django.db import models - -class Migration(DataMigration): - - def forwards(self, orm): - "Write your forwards methods here." - for reg in orm.Regulation.objects.exclude(label_string__contains="-"): - reg.root = True - reg.save() - - def backwards(self, orm): - "Write your backwards methods here." - # Rather than risk reverting roots made before this migration, just - # keep everything - - models = { - u'regcore.diff': { - 'Meta': {'unique_together': "(('label', 'old_version', 'new_version'),)", 'object_name': 'Diff', 'index_together': "(('label', 'old_version', 'new_version'),)"}, - 'diff': ('regcore.fields.CompressedJSONField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'new_version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'old_version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - }, - u'regcore.layer': { - 'Meta': {'unique_together': "(('version', 'name', 'label'),)", 'object_name': 'Layer', 'index_together': "(('version', 'name', 'label'),)"}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'layer': ('regcore.fields.CompressedJSONField', [], {}), - 'name': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - }, - u'regcore.notice': { - 'Meta': {'object_name': 'Notice'}, - 'cfr_part': ('django.db.models.fields.SlugField', [], {'max_length': '10'}), - 'document_number': ('django.db.models.fields.SlugField', [], {'max_length': '20', 'primary_key': 'True'}), - 'effective_on': ('django.db.models.fields.DateField', [], {'null': 'True'}), - 'fr_url': ('django.db.models.fields.CharField', [], {'max_length': '200'}), - 'notice': ('regcore.fields.CompressedJSONField', [], {}), - 'publication_date': ('django.db.models.fields.DateField', [], {}) - }, - u'regcore.regulation': { - 'Meta': {'unique_together': "(('version', 'label_string'),)", 'object_name': 'Regulation', 'index_together': "(('version', 'label_string'),)"}, - 'children': ('regcore.fields.CompressedJSONField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label_string': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'node_type': ('django.db.models.fields.SlugField', [], {'max_length': '10'}), - 'root': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), - 'text': ('django.db.models.fields.TextField', [], {}), - 'title': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - } - } - - complete_apps = ['regcore'] - symmetrical = True diff --git a/regcore/migrations/0006_auto__add_noticecfrpart__add_unique_noticecfrpart_notice_cfr_part__add.py b/regcore/migrations/0006_auto__add_noticecfrpart__add_unique_noticecfrpart_notice_cfr_part__add.py deleted file mode 100644 index 1b30897..0000000 --- a/regcore/migrations/0006_auto__add_noticecfrpart__add_unique_noticecfrpart_notice_cfr_part__add.py +++ /dev/null @@ -1,82 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as 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 'NoticeCFRPart' - db.create_table(u'regcore_noticecfrpart', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('cfr_part', self.gf('django.db.models.fields.SlugField')(max_length=10, db_index=True)), - ('notice', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['regcore.Notice'])), - )) - db.send_create_signal(u'regcore', ['NoticeCFRPart']) - - # Adding unique constraint on 'NoticeCFRPart', fields ['notice', 'cfr_part'] - db.create_unique(u'regcore_noticecfrpart', ['notice_id', 'cfr_part']) - - # Adding index on 'NoticeCFRPart', fields ['notice', 'cfr_part'] - db.create_index(u'regcore_noticecfrpart', ['notice_id', 'cfr_part']) - - - def backwards(self, orm): - # Removing index on 'NoticeCFRPart', fields ['notice', 'cfr_part'] - db.delete_index(u'regcore_noticecfrpart', ['notice_id', 'cfr_part']) - - # Removing unique constraint on 'NoticeCFRPart', fields ['notice', 'cfr_part'] - db.delete_unique(u'regcore_noticecfrpart', ['notice_id', 'cfr_part']) - - # Deleting model 'NoticeCFRPart' - db.delete_table(u'regcore_noticecfrpart') - - - models = { - u'regcore.diff': { - 'Meta': {'unique_together': "(('label', 'old_version', 'new_version'),)", 'object_name': 'Diff', 'index_together': "(('label', 'old_version', 'new_version'),)"}, - 'diff': ('regcore.fields.CompressedJSONField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'new_version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'old_version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - }, - u'regcore.layer': { - 'Meta': {'unique_together': "(('version', 'name', 'label'),)", 'object_name': 'Layer', 'index_together': "(('version', 'name', 'label'),)"}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'layer': ('regcore.fields.CompressedJSONField', [], {}), - 'name': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - }, - u'regcore.notice': { - 'Meta': {'object_name': 'Notice'}, - 'cfr_part': ('django.db.models.fields.SlugField', [], {'max_length': '10'}), - 'document_number': ('django.db.models.fields.SlugField', [], {'max_length': '20', 'primary_key': 'True'}), - 'effective_on': ('django.db.models.fields.DateField', [], {'null': 'True'}), - 'fr_url': ('django.db.models.fields.CharField', [], {'max_length': '200'}), - 'notice': ('regcore.fields.CompressedJSONField', [], {}), - 'publication_date': ('django.db.models.fields.DateField', [], {}) - }, - u'regcore.noticecfrpart': { - 'Meta': {'unique_together': "(('notice', 'cfr_part'),)", 'object_name': 'NoticeCFRPart', 'index_together': "(('notice', 'cfr_part'),)"}, - 'cfr_part': ('django.db.models.fields.SlugField', [], {'db_index': 'True', 'max_length': '10'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'notice': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['regcore.Notice']"}) - }, - u'regcore.regulation': { - 'Meta': {'unique_together': "(('version', 'label_string'),)", 'object_name': 'Regulation', 'index_together': "(('version', 'label_string'),)"}, - 'children': ('regcore.fields.CompressedJSONField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label_string': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'node_type': ('django.db.models.fields.SlugField', [], {'max_length': '10'}), - 'root': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), - 'text': ('django.db.models.fields.TextField', [], {}), - 'title': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - } - } - - complete_apps = ['regcore'] diff --git a/regcore/migrations/0007_multiple_cfr_parts.py b/regcore/migrations/0007_multiple_cfr_parts.py deleted file mode 100644 index b11abd9..0000000 --- a/regcore/migrations/0007_multiple_cfr_parts.py +++ /dev/null @@ -1,72 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import DataMigration -from django.db import models - -class Migration(DataMigration): - - def forwards(self, orm): - "Write your forwards methods here." - # Note: Don't use "from appname.models import ModelName". - # Use orm.ModelName to refer to models in this application, - # and orm['appname.ModelName'] for models in other applications. - for notice in orm.Notice.objects.all(): - notice.noticecfrpart_set.add( - orm.NoticeCFRPart(cfr_part=notice.cfr_part, notice=notice)) - notice.save() - - def backwards(self, orm): - "Write your backwards methods here." - for ncp in orm.NoticeCFRPart.objects.select_related(): - notice = ncp.notice - notice.cfr_part = str(ncp.cfr_part) - notice.save() - - models = { - u'regcore.diff': { - 'Meta': {'unique_together': "(('label', 'old_version', 'new_version'),)", 'object_name': 'Diff', 'index_together': "(('label', 'old_version', 'new_version'),)"}, - 'diff': ('regcore.fields.CompressedJSONField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'new_version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'old_version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - }, - u'regcore.layer': { - 'Meta': {'unique_together': "(('version', 'name', 'label'),)", 'object_name': 'Layer', 'index_together': "(('version', 'name', 'label'),)"}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'layer': ('regcore.fields.CompressedJSONField', [], {}), - 'name': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - }, - u'regcore.notice': { - 'Meta': {'object_name': 'Notice'}, - 'cfr_part': ('django.db.models.fields.SlugField', [], {'max_length': '10'}), - 'document_number': ('django.db.models.fields.SlugField', [], {'max_length': '20', 'primary_key': 'True'}), - 'effective_on': ('django.db.models.fields.DateField', [], {'null': 'True'}), - 'fr_url': ('django.db.models.fields.CharField', [], {'max_length': '200'}), - 'notice': ('regcore.fields.CompressedJSONField', [], {}), - 'publication_date': ('django.db.models.fields.DateField', [], {}) - }, - u'regcore.noticecfrpart': { - 'Meta': {'unique_together': "(('notice', 'cfr_part'),)", 'object_name': 'NoticeCFRPart', 'index_together': "(('notice', 'cfr_part'),)"}, - 'cfr_part': ('django.db.models.fields.SlugField', [], {'db_index': 'True', 'max_length': '10'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'notice': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['regcore.Notice']"}) - }, - u'regcore.regulation': { - 'Meta': {'unique_together': "(('version', 'label_string'),)", 'object_name': 'Regulation', 'index_together': "(('version', 'label_string'),)"}, - 'children': ('regcore.fields.CompressedJSONField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label_string': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'node_type': ('django.db.models.fields.SlugField', [], {'max_length': '10'}), - 'root': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), - 'text': ('django.db.models.fields.TextField', [], {}), - 'title': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - } - } - - complete_apps = ['regcore'] - symmetrical = True diff --git a/regcore/migrations/0008_auto__del_field_notice_cfr_part.py b/regcore/migrations/0008_auto__del_field_notice_cfr_part.py deleted file mode 100644 index 8250922..0000000 --- a/regcore/migrations/0008_auto__del_field_notice_cfr_part.py +++ /dev/null @@ -1,66 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Deleting field 'Notice.cfr_part' - db.delete_column(u'regcore_notice', 'cfr_part') - - - def backwards(self, orm): - # Adding field 'Notice.cfr_part' - db.add_column(u'regcore_notice', 'cfr_part', - self.gf('django.db.models.fields.SlugField')(default='????', max_length=10), - keep_default=False) - - - models = { - u'regcore.diff': { - 'Meta': {'unique_together': "(('label', 'old_version', 'new_version'),)", 'object_name': 'Diff', 'index_together': "(('label', 'old_version', 'new_version'),)"}, - 'diff': ('regcore.fields.CompressedJSONField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'new_version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'old_version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - }, - u'regcore.layer': { - 'Meta': {'unique_together': "(('version', 'name', 'label'),)", 'object_name': 'Layer', 'index_together': "(('version', 'name', 'label'),)"}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'layer': ('regcore.fields.CompressedJSONField', [], {}), - 'name': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - }, - u'regcore.notice': { - 'Meta': {'object_name': 'Notice'}, - 'document_number': ('django.db.models.fields.SlugField', [], {'max_length': '20', 'primary_key': 'True'}), - 'effective_on': ('django.db.models.fields.DateField', [], {'null': 'True'}), - 'fr_url': ('django.db.models.fields.CharField', [], {'max_length': '200'}), - 'notice': ('regcore.fields.CompressedJSONField', [], {}), - 'publication_date': ('django.db.models.fields.DateField', [], {}) - }, - u'regcore.noticecfrpart': { - 'Meta': {'unique_together': "(('notice', 'cfr_part'),)", 'object_name': 'NoticeCFRPart', 'index_together': "(('notice', 'cfr_part'),)"}, - 'cfr_part': ('django.db.models.fields.SlugField', [], {'db_index': 'True', 'max_length': '10'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'notice': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['regcore.Notice']"}) - }, - u'regcore.regulation': { - 'Meta': {'unique_together': "(('version', 'label_string'),)", 'object_name': 'Regulation', 'index_together': "(('version', 'label_string'),)"}, - 'children': ('regcore.fields.CompressedJSONField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label_string': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'node_type': ('django.db.models.fields.SlugField', [], {'max_length': '10'}), - 'root': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), - 'text': ('django.db.models.fields.TextField', [], {}), - 'title': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - } - } - - complete_apps = ['regcore'] diff --git a/regcore/migrations/0009_auto__add_field_regulation_marker.py b/regcore/migrations/0009_auto__add_field_regulation_marker.py deleted file mode 100644 index f4c9dac..0000000 --- a/regcore/migrations/0009_auto__add_field_regulation_marker.py +++ /dev/null @@ -1,67 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as 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 'Regulation.marker' - db.add_column(u'regcore_regulation', 'marker', - self.gf('django.db.models.fields.CharField')(default='', max_length=10), - keep_default=False) - - - def backwards(self, orm): - # Deleting field 'Regulation.marker' - db.delete_column(u'regcore_regulation', 'marker') - - - models = { - u'regcore.diff': { - 'Meta': {'unique_together': "(('label', 'old_version', 'new_version'),)", 'object_name': 'Diff', 'index_together': "(('label', 'old_version', 'new_version'),)"}, - 'diff': ('regcore.fields.CompressedJSONField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'new_version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'old_version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - }, - u'regcore.layer': { - 'Meta': {'unique_together': "(('version', 'name', 'label'),)", 'object_name': 'Layer', 'index_together': "(('version', 'name', 'label'),)"}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'layer': ('regcore.fields.CompressedJSONField', [], {}), - 'name': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - }, - u'regcore.notice': { - 'Meta': {'object_name': 'Notice'}, - 'document_number': ('django.db.models.fields.SlugField', [], {'max_length': '20', 'primary_key': 'True'}), - 'effective_on': ('django.db.models.fields.DateField', [], {'null': 'True'}), - 'fr_url': ('django.db.models.fields.CharField', [], {'max_length': '200'}), - 'notice': ('regcore.fields.CompressedJSONField', [], {}), - 'publication_date': ('django.db.models.fields.DateField', [], {}) - }, - u'regcore.noticecfrpart': { - 'Meta': {'unique_together': "(('notice', 'cfr_part'),)", 'object_name': 'NoticeCFRPart', 'index_together': "(('notice', 'cfr_part'),)"}, - 'cfr_part': ('django.db.models.fields.SlugField', [], {'max_length': '10'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'notice': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['regcore.Notice']"}) - }, - u'regcore.regulation': { - 'Meta': {'unique_together': "(('version', 'label_string'),)", 'object_name': 'Regulation', 'index_together': "(('version', 'label_string'),)"}, - 'children': ('regcore.fields.CompressedJSONField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label_string': ('django.db.models.fields.SlugField', [], {'max_length': '50'}), - 'marker': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '10'}), - 'node_type': ('django.db.models.fields.SlugField', [], {'max_length': '10'}), - 'root': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), - 'text': ('django.db.models.fields.TextField', [], {}), - 'title': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - } - } - - complete_apps = ['regcore'] \ No newline at end of file diff --git a/regcore/migrations/0010_auto__chg_field_layer_label__chg_field_regulation_label_string__chg_fi.py b/regcore/migrations/0010_auto__chg_field_layer_label__chg_field_regulation_label_string__chg_fi.py deleted file mode 100644 index c6d1afa..0000000 --- a/regcore/migrations/0010_auto__chg_field_layer_label__chg_field_regulation_label_string__chg_fi.py +++ /dev/null @@ -1,77 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Changing field 'Layer.label' - db.alter_column(u'regcore_layer', 'label', self.gf('django.db.models.fields.SlugField')(max_length=100)) - - # Changing field 'Regulation.label_string' - db.alter_column(u'regcore_regulation', 'label_string', self.gf('django.db.models.fields.SlugField')(max_length=100)) - - # Changing field 'Diff.label' - db.alter_column(u'regcore_diff', 'label', self.gf('django.db.models.fields.SlugField')(max_length=100)) - - def backwards(self, orm): - - # Changing field 'Layer.label' - db.alter_column(u'regcore_layer', 'label', self.gf('django.db.models.fields.SlugField')(max_length=50)) - - # Changing field 'Regulation.label_string' - db.alter_column(u'regcore_regulation', 'label_string', self.gf('django.db.models.fields.SlugField')(max_length=50)) - - # Changing field 'Diff.label' - db.alter_column(u'regcore_diff', 'label', self.gf('django.db.models.fields.SlugField')(max_length=50)) - - models = { - u'regcore.diff': { - 'Meta': {'unique_together': "(('label', 'old_version', 'new_version'),)", 'object_name': 'Diff', 'index_together': "(('label', 'old_version', 'new_version'),)"}, - 'diff': ('regcore.fields.CompressedJSONField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label': ('django.db.models.fields.SlugField', [], {'max_length': '100'}), - 'new_version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'old_version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - }, - u'regcore.layer': { - 'Meta': {'unique_together': "(('version', 'name', 'label'),)", 'object_name': 'Layer', 'index_together': "(('version', 'name', 'label'),)"}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label': ('django.db.models.fields.SlugField', [], {'max_length': '100'}), - 'layer': ('regcore.fields.CompressedJSONField', [], {}), - 'name': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - }, - u'regcore.notice': { - 'Meta': {'object_name': 'Notice'}, - 'document_number': ('django.db.models.fields.SlugField', [], {'max_length': '20', 'primary_key': 'True'}), - 'effective_on': ('django.db.models.fields.DateField', [], {'null': 'True'}), - 'fr_url': ('django.db.models.fields.CharField', [], {'max_length': '200'}), - 'notice': ('regcore.fields.CompressedJSONField', [], {}), - 'publication_date': ('django.db.models.fields.DateField', [], {}) - }, - u'regcore.noticecfrpart': { - 'Meta': {'unique_together': "(('notice', 'cfr_part'),)", 'object_name': 'NoticeCFRPart', 'index_together': "(('notice', 'cfr_part'),)"}, - 'cfr_part': ('django.db.models.fields.SlugField', [], {'max_length': '10'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'notice': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['regcore.Notice']"}) - }, - u'regcore.regulation': { - 'Meta': {'unique_together': "(('version', 'label_string'),)", 'object_name': 'Regulation', 'index_together': "(('version', 'label_string'),)"}, - 'children': ('regcore.fields.CompressedJSONField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label_string': ('django.db.models.fields.SlugField', [], {'max_length': '100'}), - 'marker': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '10'}), - 'node_type': ('django.db.models.fields.SlugField', [], {'max_length': '10'}), - 'root': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), - 'text': ('django.db.models.fields.TextField', [], {}), - 'title': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - } - } - - complete_apps = ['regcore'] diff --git a/regcore/migrations/0011_auto__chg_field_layer_label__chg_field_re.py b/regcore/migrations/0011_auto__chg_field_layer_label__chg_field_re.py deleted file mode 100644 index ec7f974..0000000 --- a/regcore/migrations/0011_auto__chg_field_layer_label__chg_field_re.py +++ /dev/null @@ -1,78 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - - # Changing field 'Layer.label' - db.alter_column(u'regcore_layer', 'label', self.gf('django.db.models.fields.SlugField')(max_length=200)) - - # Changing field 'Regulation.label_string' - db.alter_column(u'regcore_regulation', 'label_string', self.gf('django.db.models.fields.SlugField')(max_length=200)) - - # Changing field 'Diff.label' - db.alter_column(u'regcore_diff', 'label', self.gf('django.db.models.fields.SlugField')(max_length=200)) - - - def backwards(self, orm): - - # Changing field 'Layer.label' - db.alter_column(u'regcore_layer', 'label', self.gf('django.db.models.fields.SlugField')(max_length=100)) - - # Changing field 'Regulation.label_string' - db.alter_column(u'regcore_regulation', 'label_string', self.gf('django.db.models.fields.SlugField')(max_length=100)) - - # Changing field 'Diff.label' - db.alter_column(u'regcore_diff', 'label', self.gf('django.db.models.fields.SlugField')(max_length=100)) - - models = { - u'regcore.diff': { - 'Meta': {'unique_together': "(('label', 'old_version', 'new_version'),)", 'object_name': 'Diff', 'index_together': "(('label', 'old_version', 'new_version'),)"}, - 'diff': ('regcore.fields.CompressedJSONField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label': ('django.db.models.fields.SlugField', [], {'max_length': '200'}), - 'new_version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'old_version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - }, - u'regcore.layer': { - 'Meta': {'unique_together': "(('version', 'name', 'label'),)", 'object_name': 'Layer', 'index_together': "(('version', 'name', 'label'),)"}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label': ('django.db.models.fields.SlugField', [], {'max_length': '200'}), - 'layer': ('regcore.fields.CompressedJSONField', [], {}), - 'name': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - }, - u'regcore.notice': { - 'Meta': {'object_name': 'Notice'}, - 'document_number': ('django.db.models.fields.SlugField', [], {'max_length': '20', 'primary_key': 'True'}), - 'effective_on': ('django.db.models.fields.DateField', [], {'null': 'True'}), - 'fr_url': ('django.db.models.fields.CharField', [], {'max_length': '200'}), - 'notice': ('regcore.fields.CompressedJSONField', [], {}), - 'publication_date': ('django.db.models.fields.DateField', [], {}) - }, - u'regcore.noticecfrpart': { - 'Meta': {'unique_together': "(('notice', 'cfr_part'),)", 'object_name': 'NoticeCFRPart', 'index_together': "(('notice', 'cfr_part'),)"}, - 'cfr_part': ('django.db.models.fields.SlugField', [], {'max_length': '10'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'notice': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['regcore.Notice']"}) - }, - u'regcore.regulation': { - 'Meta': {'unique_together': "(('version', 'label_string'),)", 'object_name': 'Regulation', 'index_together': "(('version', 'label_string'),)"}, - 'children': ('regcore.fields.CompressedJSONField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label_string': ('django.db.models.fields.SlugField', [], {'max_length': '200'}), - 'marker': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '10'}), - 'node_type': ('django.db.models.fields.SlugField', [], {'max_length': '10'}), - 'root': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), - 'text': ('django.db.models.fields.TextField', [], {}), - 'title': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - } - } - - complete_apps = ['regcore'] diff --git a/regcore/migrations/0012_auto__add_newnotice__add_unique_newnotice_document_number_cfr_part__ad.py b/regcore/migrations/0012_auto__add_newnotice__add_unique_newnotice_document_number_cfr_part__ad.py deleted file mode 100644 index 272fb13..0000000 --- a/regcore/migrations/0012_auto__add_newnotice__add_unique_newnotice_document_number_cfr_part__ad.py +++ /dev/null @@ -1,96 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as 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 'NewNotice' - db.create_table(u'regcore_newnotice', ( - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - ('document_number', self.gf('django.db.models.fields.SlugField')(max_length=20)), - ('cfr_part', self.gf('django.db.models.fields.SlugField')(max_length=200)), - ('effective_on', self.gf('django.db.models.fields.DateField')(null=True)), - ('fr_url', self.gf('django.db.models.fields.CharField')(max_length=200)), - ('publication_date', self.gf('django.db.models.fields.DateField')()), - ('notice', self.gf('regcore.fields.CompressedJSONField')()), - )) - db.send_create_signal(u'regcore', ['NewNotice']) - - # Adding unique constraint on 'NewNotice', fields ['document_number', 'cfr_part'] - db.create_unique(u'regcore_newnotice', ['document_number', 'cfr_part']) - - # Adding index on 'NewNotice', fields ['document_number', 'cfr_part'] - db.create_index(u'regcore_newnotice', ['document_number', 'cfr_part']) - - - def backwards(self, orm): - # Removing index on 'NewNotice', fields ['document_number', 'cfr_part'] - db.delete_index(u'regcore_newnotice', ['document_number', 'cfr_part']) - - # Removing unique constraint on 'NewNotice', fields ['document_number', 'cfr_part'] - db.delete_unique(u'regcore_newnotice', ['document_number', 'cfr_part']) - - # Deleting model 'NewNotice' - db.delete_table(u'regcore_newnotice') - - - models = { - u'regcore.diff': { - 'Meta': {'unique_together': "(('label', 'old_version', 'new_version'),)", 'object_name': 'Diff', 'index_together': "(('label', 'old_version', 'new_version'),)"}, - 'diff': ('regcore.fields.CompressedJSONField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label': ('django.db.models.fields.SlugField', [], {'max_length': '200'}), - 'new_version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'old_version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - }, - u'regcore.layer': { - 'Meta': {'unique_together': "(('version', 'name', 'label'),)", 'object_name': 'Layer', 'index_together': "(('version', 'name', 'label'),)"}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label': ('django.db.models.fields.SlugField', [], {'max_length': '200'}), - 'layer': ('regcore.fields.CompressedJSONField', [], {}), - 'name': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - }, - u'regcore.newnotice': { - 'Meta': {'unique_together': "(('document_number', 'cfr_part'),)", 'object_name': 'NewNotice', 'index_together': "(('document_number', 'cfr_part'),)"}, - 'cfr_part': ('django.db.models.fields.SlugField', [], {'max_length': '200'}), - 'document_number': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'effective_on': ('django.db.models.fields.DateField', [], {'null': 'True'}), - 'fr_url': ('django.db.models.fields.CharField', [], {'max_length': '200'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'notice': ('regcore.fields.CompressedJSONField', [], {}), - 'publication_date': ('django.db.models.fields.DateField', [], {}) - }, - u'regcore.notice': { - 'Meta': {'object_name': 'Notice'}, - 'document_number': ('django.db.models.fields.SlugField', [], {'max_length': '20', 'primary_key': 'True'}), - 'effective_on': ('django.db.models.fields.DateField', [], {'null': 'True'}), - 'fr_url': ('django.db.models.fields.CharField', [], {'max_length': '200'}), - 'notice': ('regcore.fields.CompressedJSONField', [], {}), - 'publication_date': ('django.db.models.fields.DateField', [], {}) - }, - u'regcore.noticecfrpart': { - 'Meta': {'unique_together': "(('notice', 'cfr_part'),)", 'object_name': 'NoticeCFRPart', 'index_together': "(('notice', 'cfr_part'),)"}, - 'cfr_part': ('django.db.models.fields.SlugField', [], {'max_length': '10'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'notice': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['regcore.Notice']"}) - }, - u'regcore.regulation': { - 'Meta': {'unique_together': "(('version', 'label_string'),)", 'object_name': 'Regulation', 'index_together': "(('version', 'label_string'),)"}, - 'children': ('regcore.fields.CompressedJSONField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label_string': ('django.db.models.fields.SlugField', [], {'max_length': '200'}), - 'marker': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '10'}), - 'node_type': ('django.db.models.fields.SlugField', [], {'max_length': '10'}), - 'root': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), - 'text': ('django.db.models.fields.TextField', [], {}), - 'title': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - } - } - - complete_apps = ['regcore'] \ No newline at end of file diff --git a/regcore/migrations/0013_new_notice.py b/regcore/migrations/0013_new_notice.py deleted file mode 100644 index 568d512..0000000 --- a/regcore/migrations/0013_new_notice.py +++ /dev/null @@ -1,106 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import DataMigration -from django.db import models - -class Migration(DataMigration): - - def forwards(self, orm): - """ Create NewNotice instances for each Notice AND NoticeCFRPart """ - # We're going to create a new notice for every existing notice. - for notice in orm.Notice.objects.all(): - # We need to create a new notice for each notice AND - # cfr_part it applies to. - for cfr_part in notice.noticecfrpart_set.all(): - new_notice = orm.NewNotice( - document_number=notice.document_number, - cfr_part=cfr_part.cfr_part, - effective_on=notice.effective_on, - fr_url=notice.fr_url, - publication_date=notice.publication_date, - notice=notice.notice) - new_notice.save() - - def backwards(self, orm): - """ Create Notice AND NoticeCFRPart instances for each NewNotice """ - # For each NewNotice instance, we need to create a - # NoticeCFRPart, and for each unique document number create a - # Notice instance. - for notice in orm.NewNotice.objects.all(): - # See if there is already a Notice with the document number, - # if not, create it. - existing_notices = Notice.objects.filter( - document_number=notice.document_number) - - new_notice = existing_notices[0] \ - if len(existing_notices) == 0 \ - else orm.Notice( - document_number=notice.document_number, - effective_on=notice.effective_on, - fr_url=notice.fr_url, - publication_date=notice.publication_date, - notice=notice.notice) - - # Add the CFR part - new_notice.noticecfrpart_set.create(cfr_part=notice.cfr_part) - - new_notice.save() - - models = { - u'regcore.diff': { - 'Meta': {'unique_together': "(('label', 'old_version', 'new_version'),)", 'object_name': 'Diff', 'index_together': "(('label', 'old_version', 'new_version'),)"}, - 'diff': ('regcore.fields.CompressedJSONField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label': ('django.db.models.fields.SlugField', [], {'max_length': '200'}), - 'new_version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'old_version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - }, - u'regcore.layer': { - 'Meta': {'unique_together': "(('version', 'name', 'label'),)", 'object_name': 'Layer', 'index_together': "(('version', 'name', 'label'),)"}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label': ('django.db.models.fields.SlugField', [], {'max_length': '200'}), - 'layer': ('regcore.fields.CompressedJSONField', [], {}), - 'name': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - }, - u'regcore.newnotice': { - 'Meta': {'unique_together': "(('document_number', 'cfr_part'),)", 'object_name': 'NewNotice', 'index_together': "(('document_number', 'cfr_part'),)"}, - 'cfr_part': ('django.db.models.fields.SlugField', [], {'max_length': '200'}), - 'document_number': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'effective_on': ('django.db.models.fields.DateField', [], {'null': 'True'}), - 'fr_url': ('django.db.models.fields.CharField', [], {'max_length': '200'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'notice': ('regcore.fields.CompressedJSONField', [], {}), - 'publication_date': ('django.db.models.fields.DateField', [], {}) - }, - u'regcore.notice': { - 'Meta': {'object_name': 'Notice'}, - 'document_number': ('django.db.models.fields.SlugField', [], {'max_length': '20', 'primary_key': 'True'}), - 'effective_on': ('django.db.models.fields.DateField', [], {'null': 'True'}), - 'fr_url': ('django.db.models.fields.CharField', [], {'max_length': '200'}), - 'notice': ('regcore.fields.CompressedJSONField', [], {}), - 'publication_date': ('django.db.models.fields.DateField', [], {}) - }, - u'regcore.noticecfrpart': { - 'Meta': {'unique_together': "(('notice', 'cfr_part'),)", 'object_name': 'NoticeCFRPart', 'index_together': "(('notice', 'cfr_part'),)"}, - 'cfr_part': ('django.db.models.fields.SlugField', [], {'max_length': '10'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'notice': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['regcore.Notice']"}) - }, - u'regcore.regulation': { - 'Meta': {'unique_together': "(('version', 'label_string'),)", 'object_name': 'Regulation', 'index_together': "(('version', 'label_string'),)"}, - 'children': ('regcore.fields.CompressedJSONField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label_string': ('django.db.models.fields.SlugField', [], {'max_length': '200'}), - 'marker': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '10'}), - 'node_type': ('django.db.models.fields.SlugField', [], {'max_length': '10'}), - 'root': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), - 'text': ('django.db.models.fields.TextField', [], {}), - 'title': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - } - } - - complete_apps = ['regcore'] - symmetrical = True diff --git a/regcore/migrations/0014_auto__del_notice__del_noticecfrpart__del_unique_noticecfrpart_notice_c.py b/regcore/migrations/0014_auto__del_notice__del_noticecfrpart__del_unique_noticecfrpart_notice_c.py deleted file mode 100644 index 86c219d..0000000 --- a/regcore/migrations/0014_auto__del_notice__del_noticecfrpart__del_unique_noticecfrpart_notice_c.py +++ /dev/null @@ -1,91 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Removing unique constraint on 'NoticeCFRPart', fields ['notice', 'cfr_part'] - db.delete_unique(u'regcore_noticecfrpart', ['notice_id', 'cfr_part']) - - # Removing index on 'NoticeCFRPart', fields ['notice', 'cfr_part'] - db.delete_index(u'regcore_noticecfrpart', ['notice_id', 'cfr_part']) - - # Deleting model 'Notice' - db.delete_table(u'regcore_notice') - - # Deleting model 'NoticeCFRPart' - db.delete_table(u'regcore_noticecfrpart') - - - def backwards(self, orm): - # Adding index on 'NoticeCFRPart', fields ['notice', 'cfr_part'] - db.create_index(u'regcore_noticecfrpart', ['notice_id', 'cfr_part']) - - # Adding model 'Notice' - db.create_table(u'regcore_notice', ( - ('notice', self.gf('regcore.fields.CompressedJSONField')()), - ('effective_on', self.gf('django.db.models.fields.DateField')(null=True)), - ('document_number', self.gf('django.db.models.fields.SlugField')(max_length=20, primary_key=True)), - ('fr_url', self.gf('django.db.models.fields.CharField')(max_length=200)), - ('publication_date', self.gf('django.db.models.fields.DateField')()), - )) - db.send_create_signal(u'regcore', ['Notice']) - - # Adding model 'NoticeCFRPart' - db.create_table(u'regcore_noticecfrpart', ( - ('notice', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['regcore.Notice'])), - ('cfr_part', self.gf('django.db.models.fields.SlugField')(max_length=10)), - (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), - )) - db.send_create_signal(u'regcore', ['NoticeCFRPart']) - - # Adding unique constraint on 'NoticeCFRPart', fields ['notice', 'cfr_part'] - db.create_unique(u'regcore_noticecfrpart', ['notice_id', 'cfr_part']) - - - models = { - u'regcore.diff': { - 'Meta': {'unique_together': "(('label', 'old_version', 'new_version'),)", 'object_name': 'Diff', 'index_together': "(('label', 'old_version', 'new_version'),)"}, - 'diff': ('regcore.fields.CompressedJSONField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label': ('django.db.models.fields.SlugField', [], {'max_length': '200'}), - 'new_version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'old_version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - }, - u'regcore.layer': { - 'Meta': {'unique_together': "(('version', 'name', 'label'),)", 'object_name': 'Layer', 'index_together': "(('version', 'name', 'label'),)"}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label': ('django.db.models.fields.SlugField', [], {'max_length': '200'}), - 'layer': ('regcore.fields.CompressedJSONField', [], {}), - 'name': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - }, - u'regcore.newnotice': { - 'Meta': {'unique_together': "(('document_number', 'cfr_part'),)", 'object_name': 'NewNotice', 'index_together': "(('document_number', 'cfr_part'),)"}, - 'cfr_part': ('django.db.models.fields.SlugField', [], {'max_length': '200'}), - 'document_number': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'effective_on': ('django.db.models.fields.DateField', [], {'null': 'True'}), - 'fr_url': ('django.db.models.fields.CharField', [], {'max_length': '200'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'notice': ('regcore.fields.CompressedJSONField', [], {}), - 'publication_date': ('django.db.models.fields.DateField', [], {}) - }, - u'regcore.regulation': { - 'Meta': {'unique_together': "(('version', 'label_string'),)", 'object_name': 'Regulation', 'index_together': "(('version', 'label_string'),)"}, - 'children': ('regcore.fields.CompressedJSONField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label_string': ('django.db.models.fields.SlugField', [], {'max_length': '200'}), - 'marker': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '10'}), - 'node_type': ('django.db.models.fields.SlugField', [], {'max_length': '10'}), - 'root': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), - 'text': ('django.db.models.fields.TextField', [], {}), - 'title': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - } - } - - complete_apps = ['regcore'] diff --git a/regcore/migrations/0015_auto__del_newnotice__del_unique_newnotice_document_number_cfr_part__de.py b/regcore/migrations/0015_auto__del_newnotice__del_unique_newnotice_document_number_cfr_part__de.py deleted file mode 100644 index e7621ba..0000000 --- a/regcore/migrations/0015_auto__del_newnotice__del_unique_newnotice_document_number_cfr_part__de.py +++ /dev/null @@ -1,85 +0,0 @@ -# -*- coding: utf-8 -*- -from south.utils import datetime_utils as datetime -from south.db import db -from south.v2 import SchemaMigration -from django.db import models - - -class Migration(SchemaMigration): - - def forwards(self, orm): - # Removing unique constraint on 'NewNotice', fields ['document_number', 'cfr_part'] - db.delete_unique(u'regcore_newnotice', ['document_number', 'cfr_part']) - - # Removing index on 'NewNotice', fields ['document_number', 'cfr_part'] - db.delete_index(u'regcore_newnotice', ['document_number', 'cfr_part']) - - # Rename the table - db.rename_table(u'regcore_newnotice', u'regcore_notice') - - # Adding unique constraint on 'Notice', fields ['document_number', 'cfr_part'] - db.create_unique(u'regcore_notice', ['document_number', 'cfr_part']) - - # Adding index on 'Notice', fields ['document_number', 'cfr_part'] - db.create_index(u'regcore_notice', ['document_number', 'cfr_part']) - - - def backwards(self, orm): - # Removing index on 'Notice', fields ['document_number', 'cfr_part'] - db.delete_index(u'regcore_notice', ['document_number', 'cfr_part']) - - # Removing unique constraint on 'Notice', fields ['document_number', 'cfr_part'] - db.delete_unique(u'regcore_notice', ['document_number', 'cfr_part']) - - # Rename the table - db.rename_table(u'regcore_notice', u'regcore_newnotice') - - # Adding index on 'NewNotice', fields ['document_number', 'cfr_part'] - db.create_index(u'regcore_newnotice', ['document_number', 'cfr_part']) - - # Adding unique constraint on 'NewNotice', fields ['document_number', 'cfr_part'] - db.create_unique(u'regcore_newnotice', ['document_number', 'cfr_part']) - - - models = { - u'regcore.diff': { - 'Meta': {'unique_together': "(('label', 'old_version', 'new_version'),)", 'object_name': 'Diff', 'index_together': "(('label', 'old_version', 'new_version'),)"}, - 'diff': ('regcore.fields.CompressedJSONField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label': ('django.db.models.fields.SlugField', [], {'max_length': '200'}), - 'new_version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'old_version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - }, - u'regcore.layer': { - 'Meta': {'unique_together': "(('version', 'name', 'label'),)", 'object_name': 'Layer', 'index_together': "(('version', 'name', 'label'),)"}, - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label': ('django.db.models.fields.SlugField', [], {'max_length': '200'}), - 'layer': ('regcore.fields.CompressedJSONField', [], {}), - 'name': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - }, - u'regcore.notice': { - 'Meta': {'unique_together': "(('document_number', 'cfr_part'),)", 'object_name': 'Notice', 'index_together': "(('document_number', 'cfr_part'),)"}, - 'cfr_part': ('django.db.models.fields.SlugField', [], {'max_length': '200'}), - 'document_number': ('django.db.models.fields.SlugField', [], {'max_length': '20'}), - 'effective_on': ('django.db.models.fields.DateField', [], {'null': 'True'}), - 'fr_url': ('django.db.models.fields.CharField', [], {'max_length': '200'}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'notice': ('regcore.fields.CompressedJSONField', [], {}), - 'publication_date': ('django.db.models.fields.DateField', [], {}) - }, - u'regcore.regulation': { - 'Meta': {'unique_together': "(('version', 'label_string'),)", 'object_name': 'Regulation', 'index_together': "(('version', 'label_string'),)"}, - 'children': ('regcore.fields.CompressedJSONField', [], {}), - u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), - 'label_string': ('django.db.models.fields.SlugField', [], {'max_length': '200'}), - 'marker': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '10'}), - 'node_type': ('django.db.models.fields.SlugField', [], {'max_length': '10'}), - 'root': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}), - 'text': ('django.db.models.fields.TextField', [], {}), - 'title': ('django.db.models.fields.TextField', [], {'blank': 'True'}), - 'version': ('django.db.models.fields.SlugField', [], {'max_length': '20'}) - } - } - - complete_apps = ['regcore'] diff --git a/regcore/settings/base.py b/regcore/settings/base.py index bb65e87..e20a3c2 100644 --- a/regcore/settings/base.py +++ b/regcore/settings/base.py @@ -10,7 +10,6 @@ 'regcore', 'regcore_read', 'regcore_write', - 'south' ] SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', get_random_string(50)) diff --git a/requirements.txt b/requirements.txt index 28b3a3d..87edda0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -django==1.6 +django==1.8.11 django-haystack jsonschema pyelasticsearch From 0df84af5068d35727d6e138cbf1cf07e3035555f Mon Sep 17 00:00:00 2001 From: Will Barton Date: Mon, 11 Apr 2016 13:11:57 -0400 Subject: [PATCH 2/6] Stop testing Python 2.6 --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 983d764..28ee7d0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ language: python sudo: false python: - - "2.6" - "2.7" install: - pip install -r requirements.txt From aa51ba7736be62f42efaf9a5800db6e7c4165f41 Mon Sep 17 00:00:00 2001 From: CM Lubinski Date: Wed, 9 Sep 2015 22:43:40 +0000 Subject: [PATCH 3/6] Use SimpleEngine for default config --- regcore/settings/base.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/regcore/settings/base.py b/regcore/settings/base.py index e20a3c2..23a1edc 100644 --- a/regcore/settings/base.py +++ b/regcore/settings/base.py @@ -45,8 +45,7 @@ HAYSTACK_CONNECTIONS = { 'default': { - 'ENGINE': 'haystack.backends.solr_backend.SolrEngine', - 'URL': 'http://localhost:8983/solr' + 'ENGINE': 'haystack.backends.simple_backend.SimpleEngine', } } From 7b80173efc0d4e47a9e860746cdf57553a98f1c4 Mon Sep 17 00:00:00 2001 From: CM Lubinski Date: Tue, 8 Sep 2015 16:06:43 +0000 Subject: [PATCH 4/6] Remove warnings when starting/testing the app --- regcore/db/__init__.py | 3 +-- regcore/settings/base.py | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/regcore/db/__init__.py b/regcore/db/__init__.py index 3c67457..26e0e7c 100644 --- a/regcore/db/__init__.py +++ b/regcore/db/__init__.py @@ -3,10 +3,9 @@ the associated backend class instead (e.g. for Django, elastic search, or the splitter backend).""" -import sys +from importlib import import_module from django.conf import settings -from django.utils.importlib import import_module def _select(key): diff --git a/regcore/settings/base.py b/regcore/settings/base.py index 23a1edc..3df60ce 100644 --- a/regcore/settings/base.py +++ b/regcore/settings/base.py @@ -11,6 +11,7 @@ 'regcore_read', 'regcore_write', ] +MIDDLEWARE_CLASSES = [] SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', get_random_string(50)) From 97f99897f4742273c7815fbe87db3c434521cc17 Mon Sep 17 00:00:00 2001 From: CM Lubinski Date: Tue, 8 Sep 2015 16:06:19 +0000 Subject: [PATCH 5/6] Updated README to no longer reference south --- README.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 3248131..265e5de 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,6 @@ Requirements are retrieved and/or build automatically via pip (see below). * pyelasticsearch - required if using Elastic Search * flake8 - while not strictly required, we try to meet its standards * pysolr - required if using solr as a search backend -* south - Django's migration helper. Needed if using Django Models for - storage ## API Docs @@ -121,13 +119,13 @@ BACKENDS = { } ``` -Remember to run south migrations. +Remember to run migrations. ### Django Models For Data, Elastic Search For Search -If *pyelasticsearch* and *south* are installed, you can combine Django -models and Elastic Search. Use the *regcore_read.views.es_search.search* and -use the following backend configuration: +If *pyelasticsearch* is installed, you can combine Django models and Elastic +Search. Use the *regcore_read.views.es_search.search* and use the following +backend configuration: ```python BACKENDS = { @@ -138,7 +136,7 @@ BACKENDS = { } ``` -Be sure to also run south migration +Be sure to also run migrations ### Elastic Search For Data and Search From d48fcdc7c74b5e2cdeca524d4f5783c15c019b3d Mon Sep 17 00:00:00 2001 From: Will Barton Date: Mon, 11 Apr 2016 15:06:18 -0400 Subject: [PATCH 6/6] Bump the version to 1.2.0 in anticipation of new GitHub release --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c0f2771..a241222 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name = "regcore", - version = "0.1.0", + version = "1.2.0", license = "public domain", packages = find_packages() )