summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/migrations/0082_auto_20190118_1203.py95
-rw-r--r--ishtar_common/models.py9
2 files changed, 103 insertions, 1 deletions
diff --git a/ishtar_common/migrations/0082_auto_20190118_1203.py b/ishtar_common/migrations/0082_auto_20190118_1203.py
new file mode 100644
index 000000000..87f5146e7
--- /dev/null
+++ b/ishtar_common/migrations/0082_auto_20190118_1203.py
@@ -0,0 +1,95 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.10 on 2019-01-18 12:03
+from __future__ import unicode_literals
+
+from django.conf import settings
+import django.contrib.postgres.fields.jsonb
+from django.db import migrations, models
+import django.db.models.deletion
+import ishtar_common.models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ migrations.swappable_dependency(settings.AUTH_USER_MODEL),
+ ('ishtar_common', '0081_recreate_m2m_history'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='document',
+ name='data',
+ field=django.contrib.postgres.fields.jsonb.JSONField(blank=True, db_index=True, default={}),
+ ),
+ migrations.AddField(
+ model_name='document',
+ name='history_creator',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL, verbose_name='Cr\xe9ateur'),
+ ),
+ migrations.AddField(
+ model_name='document',
+ name='history_m2m',
+ field=django.contrib.postgres.fields.jsonb.JSONField(blank=True, default={}),
+ ),
+ migrations.AddField(
+ model_name='document',
+ name='history_modifier',
+ field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL, verbose_name='Dernier \xe9diteur'),
+ ),
+ migrations.AddField(
+ model_name='document',
+ name='last_modified',
+ field=models.DateTimeField(auto_now=True),
+ ),
+ migrations.AddField(
+ model_name='ishtarsiteprofile',
+ name='document_external_id',
+ field=models.TextField(default='{index}', help_text='Formula to manage document external ID. Change this with care. With incorrect formula, the application might be unusable and import of external data can be destructive.', verbose_name='Document external id'),
+ ),
+ migrations.AlterField(
+ model_name='document',
+ name='associated_file',
+ field=models.FileField(blank=True, help_text='The maximum supported file size is 100 Mo.', max_length=255, null=True, upload_to=ishtar_common.models.get_image_path),
+ ),
+ migrations.AlterField(
+ model_name='document',
+ name='image',
+ field=models.ImageField(blank=True, help_text='The maximum supported file size is 100 Mo.', max_length=255, null=True, upload_to=ishtar_common.models.get_image_path),
+ ),
+ migrations.AlterField(
+ model_name='document',
+ name='thumbnail',
+ field=models.ImageField(blank=True, help_text='The maximum supported file size is 100 Mo.', max_length=255, null=True, upload_to=ishtar_common.models.get_image_path),
+ ),
+ migrations.AlterField(
+ model_name='documenttemplate',
+ name='template',
+ field=models.FileField(help_text='The maximum supported file size is 100 Mo.', upload_to=b'templates/%Y/', verbose_name='Patron'),
+ ),
+ migrations.AlterField(
+ model_name='import',
+ name='error_file',
+ field=models.FileField(blank=True, help_text='The maximum supported file size is 100 Mo.', max_length=255, null=True, upload_to=b'upload/imports/%Y/%m/', verbose_name='Fichier erreur'),
+ ),
+ migrations.AlterField(
+ model_name='import',
+ name='imported_file',
+ field=models.FileField(help_text='The maximum supported file size is 100 Mo.', max_length=220, upload_to=b'upload/imports/%Y/%m/', verbose_name='Fichier import\xe9'),
+ ),
+ migrations.AlterField(
+ model_name='import',
+ name='imported_images',
+ field=models.FileField(blank=True, help_text='The maximum supported file size is 100 Mo.', max_length=220, null=True, upload_to=b'upload/imports/%Y/%m/', verbose_name='Images associ\xe9es (fichier zip)'),
+ ),
+ migrations.AlterField(
+ model_name='import',
+ name='match_file',
+ field=models.FileField(blank=True, help_text='The maximum supported file size is 100 Mo.', max_length=255, null=True, upload_to=b'upload/imports/%Y/%m/', verbose_name='Fichier de correspondance'),
+ ),
+ migrations.AlterField(
+ model_name='import',
+ name='result_file',
+ field=models.FileField(blank=True, help_text='The maximum supported file size is 100 Mo.', max_length=255, null=True, upload_to=b'upload/imports/%Y/%m/', verbose_name='Fichier r\xe9sultant'),
+ ),
+ ]
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index 8fb6df3ac..4078b5840 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -2087,6 +2087,13 @@ class IshtarSiteProfile(models.Model, Cached):
u"Change this with care. With incorrect formula, the "
u"application might be unusable and import of external "
u"data can be destructive."))
+ document_external_id = models.TextField(
+ _(u"Document external id"),
+ default=u"{index}",
+ help_text=_(u"Formula to manage document external ID. "
+ u"Change this with care. With incorrect formula, the "
+ u"application might be unusable and import of external "
+ u"data can be destructive."))
person_raw_name = models.TextField(
_(u"Raw name for person"),
default=u"{name|upper} {surname}",
@@ -3754,7 +3761,7 @@ post_save.connect(post_save_cache, sender=LicenseType)
post_delete.connect(post_save_cache, sender=LicenseType)
-class Document(OwnPerms, ImageModel, FullSearch, Imported):
+class Document(BaseHistorizedItem, OwnPerms, ImageModel):
# order is important: put the image in the first match found
# other will be symbolic links
RELATED_MODELS = [