summaryrefslogtreecommitdiff
path: root/archaeological_finds
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_finds')
-rw-r--r--archaeological_finds/forms.py12
-rw-r--r--archaeological_finds/migrations/0014_auto_20171110_1717.py26
-rw-r--r--archaeological_finds/models_finds.py5
-rw-r--r--archaeological_finds/models_treatments.py4
4 files changed, 38 insertions, 9 deletions
diff --git a/archaeological_finds/forms.py b/archaeological_finds/forms.py
index b88ee164e..2a895064f 100644
--- a/archaeological_finds/forms.py
+++ b/archaeological_finds/forms.py
@@ -41,7 +41,7 @@ import models
from ishtar_common.forms import FormSet, FloatField, \
get_form_selection, reverse_lazy, TableSelect, get_now, FinalForm, \
- ManageOldType
+ ManageOldType, FieldType
from ishtar_common.forms_common import get_town_field, SourceSelect
from ishtar_common.utils import convert_coordinates_to_point
@@ -316,11 +316,11 @@ class PreservationForm(ManageOldType, forms.Form):
widget=forms.Textarea)
TYPES = [
- ('conservatory_state', models.ConservatoryState, False),
- ('treatment_emergency', models.TreatmentEmergencyType, False),
- ('preservation_to_consider', models.TreatmentType, True),
- ('alteration', models.AlterationType, True),
- ('alteration_cause', models.AlterationCauseType, True),
+ FieldType('conservatory_state', models.ConservatoryState),
+ FieldType('treatment_emergency', models.TreatmentEmergencyType),
+ FieldType('preservation_to_consider', models.TreatmentType, True),
+ FieldType('alteration', models.AlterationType, True),
+ FieldType('alteration_cause', models.AlterationCauseType, True),
]
def __init__(self, *args, **kwargs):
diff --git a/archaeological_finds/migrations/0014_auto_20171110_1717.py b/archaeological_finds/migrations/0014_auto_20171110_1717.py
new file mode 100644
index 000000000..63458bd9b
--- /dev/null
+++ b/archaeological_finds/migrations/0014_auto_20171110_1717.py
@@ -0,0 +1,26 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11 on 2017-11-10 17:17
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('ishtar_common', '0021_auto_20171110_1717'),
+ ('archaeological_finds', '0013_auto_20171026_1828'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='find',
+ name='images',
+ field=models.ManyToManyField(blank=True, to='ishtar_common.IshtarImage', verbose_name='Images'),
+ ),
+ migrations.AddField(
+ model_name='treatment',
+ name='images',
+ field=models.ManyToManyField(blank=True, to='ishtar_common.IshtarImage', verbose_name='Images'),
+ ),
+ ]
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py
index 8be440181..2b782c614 100644
--- a/archaeological_finds/models_finds.py
+++ b/archaeological_finds/models_finds.py
@@ -34,7 +34,7 @@ from ishtar_common.utils import cached_label_changed, post_save_point
from ishtar_common.models import GeneralType, HierarchicalType, ImageModel, \
BaseHistorizedItem, ShortMenuItem, LightHistorizedItem, \
HistoricalRecords, OwnPerms, Source, Person, Basket, post_save_cache, \
- ValueGetter, get_current_profile
+ ValueGetter, get_current_profile, IshtarImage
from archaeological_operations.models import AdministrativeAct
from archaeological_context_records.models import ContextRecord, Dating
@@ -750,7 +750,8 @@ class Find(BulkUpdatedItem, ValueGetter, BaseHistorizedItem, ImageModel,
null=True)
appraisal_date = models.DateField(_(u"Appraisal date"), blank=True,
null=True)
-
+ images = models.ManyToManyField(IshtarImage, verbose_name=_(u"Images"),
+ blank=True)
cached_label = models.TextField(_(u"Cached name"), null=True, blank=True,
db_index=True)
history = HistoricalRecords()
diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py
index 03eeed452..6c173959a 100644
--- a/archaeological_finds/models_treatments.py
+++ b/archaeological_finds/models_treatments.py
@@ -30,7 +30,7 @@ from django.utils.translation import ugettext_lazy as _, ugettext
from ishtar_common.utils import cached_label_changed, get_current_year
from ishtar_common.models import GeneralType, ImageModel, BaseHistorizedItem, \
OwnPerms, HistoricalRecords, Person, Organization, Source, \
- ValueGetter, post_save_cache, ShortMenuItem, DashboardFormItem
+ ValueGetter, post_save_cache, ShortMenuItem, DashboardFormItem, IshtarImage
from archaeological_warehouse.models import Warehouse, Container
from archaeological_finds.models_finds import Find, FindBasket, TreatmentType
from archaeological_operations.models import ClosedItem, Operation
@@ -115,6 +115,8 @@ class Treatment(DashboardFormItem, ValueGetter, BaseHistorizedItem,
blank=True, null=True)
target_is_basket = models.BooleanField(_(u"Target a basket"),
default=False)
+ images = models.ManyToManyField(IshtarImage, verbose_name=_(u"Images"),
+ blank=True)
cached_label = models.TextField(_(u"Cached name"), null=True, blank=True,
db_index=True)
history = HistoricalRecords()