summaryrefslogtreecommitdiff
path: root/archaeological_files
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2020-10-06 19:44:11 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2021-02-28 12:15:21 +0100
commitce17a92be9c98753911987d12bf30ea9485e8e3f (patch)
tree04961ac0119f44f5c46cb4356733f8bf2b5b0c1d /archaeological_files
parentc37576c628db687260975c0d1d219c196a2bc9a5 (diff)
downloadIshtar-ce17a92be9c98753911987d12bf30ea9485e8e3f.tar.bz2
Ishtar-ce17a92be9c98753911987d12bf30ea9485e8e3f.zip
Complete identifier field: database - profile settings - save
Diffstat (limited to 'archaeological_files')
-rw-r--r--archaeological_files/migrations/0103_auto_20201007_1215.py36
-rw-r--r--archaeological_files/models.py10
2 files changed, 41 insertions, 5 deletions
diff --git a/archaeological_files/migrations/0103_auto_20201007_1215.py b/archaeological_files/migrations/0103_auto_20201007_1215.py
new file mode 100644
index 000000000..d6f626fa9
--- /dev/null
+++ b/archaeological_files/migrations/0103_auto_20201007_1215.py
@@ -0,0 +1,36 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.27 on 2020-10-07 12:15
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+import ishtar_common.models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('archaeological_files', '0102_historicalfile_history_change_reason'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='file',
+ name='complete_identifier',
+ field=models.TextField(blank=True, verbose_name='Complete identifier'),
+ ),
+ migrations.AddField(
+ model_name='file',
+ name='qrcode',
+ field=models.ImageField(blank=True, max_length=255, null=True, upload_to=ishtar_common.models.get_image_path),
+ ),
+ migrations.AddField(
+ model_name='historicalfile',
+ name='complete_identifier',
+ field=models.TextField(blank=True, verbose_name='Complete identifier'),
+ ),
+ migrations.AddField(
+ model_name='historicalfile',
+ name='qrcode',
+ field=models.TextField(blank=True, max_length=255, null=True),
+ ),
+ ]
diff --git a/archaeological_files/models.py b/archaeological_files/models.py
index 8afd57d01..455d65af8 100644
--- a/archaeological_files/models.py
+++ b/archaeological_files/models.py
@@ -34,8 +34,8 @@ from ishtar_common.utils import cached_label_changed, get_cache, \
from ishtar_common.models import GeneralType, BaseHistorizedItem, \
OwnPerms, Person, Organization, Town, \
Dashboard, DashboardFormItem, ValueGetter, ShortMenuItem, \
- OperationType, get_external_id, post_save_cache, Document, HistoryModel, \
- SearchAltName, SearchVectorConfig, DocumentItem
+ OperationType, get_generated_id, post_save_cache, Document, HistoryModel, \
+ SearchAltName, SearchVectorConfig, DocumentItem, CompleteIdentifierItem
from ishtar_common.models_common import HistoricalRecords, Department
@@ -86,8 +86,8 @@ if settings.COUNTRY == 'fr':
post_delete.connect(post_save_cache, sender=SaisineType)
-class File(ClosedItem, DocumentItem, BaseHistorizedItem, OwnPerms, ValueGetter,
- ShortMenuItem, DashboardFormItem, ParcelItem):
+class File(ClosedItem, DocumentItem, BaseHistorizedItem, CompleteIdentifierItem,
+ OwnPerms, ValueGetter, ShortMenuItem, DashboardFormItem, ParcelItem):
SLUG = 'file'
SHOW_URL = 'show-file'
DELETE_URL = 'delete-file'
@@ -716,7 +716,7 @@ class File(ClosedItem, DocumentItem, BaseHistorizedItem, OwnPerms, ValueGetter,
updated += self.update_corpo_general_contractor()
if not self.external_id or self.auto_external_id:
- external_id = get_external_id('file_external_id', self)
+ external_id = get_generated_id('file_external_id', self)
if external_id != self.external_id:
updated = True
self.auto_external_id = True