summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/migrations/0066_auto_20180816_1114.py46
-rw-r--r--ishtar_common/models.py13
2 files changed, 58 insertions, 1 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)
+ ]
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index 8bab21360..bd800181f 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -1210,7 +1210,6 @@ class FullSearch(models.Model):
[data])
row = cursor.fetchone()
search_vectors.append(row[0])
- # self.search_vector = merge_tsvectors(search_vectors)
new_search_vector = merge_tsvectors(search_vectors)
changed = old_search != new_search_vector
if save and changed:
@@ -1720,6 +1719,18 @@ class IshtarSiteProfile(models.Model, Cached):
help_text=_(u"Homepage of Ishtar - if not defined a default homepage "
u"will appear. Use the markdown syntax. {random_image} "
u"can be used to display a random image."))
+ operation_prefix = models.CharField(
+ _(u"Main operation code prefix"), default=u'OA', null=True, blank=True,
+ max_length=20
+ )
+ default_operation_prefix = models.CharField(
+ _(u"Default operation code prefix"), default=u'OP', null=True,
+ blank=True, max_length=20
+ )
+ operation_region_code = models.CharField(
+ _(u"Operation region code"), null=True, blank=True,
+ max_length=5
+ )
file_external_id = models.TextField(
_(u"File external id"),
default=u"{year}-{numeric_reference}",