summaryrefslogtreecommitdiff
path: root/ishtar_common/migrations/0066_auto_20180816_1114.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/migrations/0066_auto_20180816_1114.py')
-rw-r--r--ishtar_common/migrations/0066_auto_20180816_1114.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/ishtar_common/migrations/0066_auto_20180816_1114.py b/ishtar_common/migrations/0066_auto_20180816_1114.py
new file mode 100644
index 000000000..3d2d8ca23
--- /dev/null
+++ b/ishtar_common/migrations/0066_auto_20180816_1114.py
@@ -0,0 +1,46 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.10 on 2018-08-16 11:14
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+from django.conf import settings
+
+
+def migrate_codes(apps, schema_editor):
+ IshtarSiteProfile = apps.get_model('ishtar_common', 'IshtarSiteProfile')
+ for p in IshtarSiteProfile.objects.all():
+ if settings.ISHTAR_OPE_PREFIX:
+ p.operation_prefix = settings.ISHTAR_OPE_PREFIX
+ if settings.ISHTAR_DEF_OPE_PREFIX:
+ p.default_operation_prefix = settings.ISHTAR_DEF_OPE_PREFIX
+ p.save()
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('ishtar_common', '0065_author_cached_label'),
+ ]
+
+ operations = [
+ migrations.AlterModelOptions(
+ name='document',
+ options={'ordering': ('title',), 'permissions': (('view_document', 'Peut voir tous les Documents'), ('view_own_document', 'Peut voir ses propres Documents'), ('add_own_document', 'Peut ajouter son propre Document'), ('change_own_document', 'Peut modifier ses propres documents'), ('delete_own_document', 'Peut supprimer ses propres Documents')), 'verbose_name': 'Document', 'verbose_name_plural': 'Documents'},
+ ),
+ migrations.AddField(
+ model_name='ishtarsiteprofile',
+ name='default_operation_prefix',
+ field=models.CharField(blank=True, default='OP', max_length=20, null=True, verbose_name='Default operation code prefix'),
+ ),
+ migrations.AddField(
+ model_name='ishtarsiteprofile',
+ name='operation_prefix',
+ field=models.CharField(blank=True, default='OA', max_length=20, null=True, verbose_name='Main operation code prefix'),
+ ),
+ migrations.AddField(
+ model_name='ishtarsiteprofile',
+ name='operation_region_code',
+ field=models.CharField(blank=True, max_length=5, null=True, verbose_name='Operation region code'),
+ ),
+ migrations.RunPython(migrate_codes)
+ ]