diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-12-09 11:15:29 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2019-12-09 11:15:29 +0100 |
commit | 07625e43bd16326588c1df55216a185f2250ab8c (patch) | |
tree | a94f9ed06618b65adc3b7236c8f3cf292a67e774 /archaeological_operations | |
parent | 7aef1591ce842c4223298ebbe221519b542b6285 (diff) | |
download | Ishtar-07625e43bd16326588c1df55216a185f2250ab8c.tar.bz2 Ishtar-07625e43bd16326588c1df55216a185f2250ab8c.zip |
Site: add other reference
Diffstat (limited to 'archaeological_operations')
-rw-r--r-- | archaeological_operations/forms.py | 6 | ||||
-rw-r--r-- | archaeological_operations/migrations/0073_auto_20191209_1058.py | 25 | ||||
-rw-r--r-- | archaeological_operations/models.py | 7 | ||||
-rw-r--r-- | archaeological_operations/templates/ishtar/sheet_site.html | 3 |
4 files changed, 40 insertions, 1 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index 32ec6f826..18534fe9d 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -1221,6 +1221,8 @@ class ArchaeologicalSiteForm(ManageOldType): HEADERS = {} reference = forms.CharField(label=_(u"Reference"), max_length=200) name = forms.CharField(label=_(u"Name"), max_length=200, required=False) + other_reference = forms.CharField(label=_(u"Other reference"), + required=False) periods = forms.MultipleChoiceField( label=_("Periods"), choices=[], widget=widgets.Select2Multiple, required=False) @@ -1374,6 +1376,8 @@ class SiteSelect(HistorySelect): reference = forms.CharField(label=_(u"Reference"), max_length=200, required=False) name = forms.CharField(label=_(u"Name"), max_length=200, required=False) + other_reference = forms.CharField(label=_("Other reference"), + max_length=200, required=False) periods = forms.ChoiceField(label=_(u"Periods"), choices=[], required=False) remains = forms.ChoiceField(label=_(u"Remains"), choices=[], required=False) cultural_attributions = forms.ChoiceField( @@ -1487,6 +1491,8 @@ class SiteForm(CustomForm, ManageOldType): pk = forms.IntegerField(required=False, widget=forms.HiddenInput) reference = forms.CharField(label=_(u"Reference"), max_length=200) name = forms.CharField(label=_(u"Name"), max_length=200, required=False) + other_reference = forms.CharField(label=_("Other reference"), + required=False) period = forms.MultipleChoiceField( label=_("Periods"), choices=[], widget=widgets.Select2Multiple, required=False) diff --git a/archaeological_operations/migrations/0073_auto_20191209_1058.py b/archaeological_operations/migrations/0073_auto_20191209_1058.py new file mode 100644 index 000000000..53049837c --- /dev/null +++ b/archaeological_operations/migrations/0073_auto_20191209_1058.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.18 on 2019-12-09 10:58 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('archaeological_operations', '0072_create_view'), + ] + + operations = [ + migrations.AddField( + model_name='archaeologicalsite', + name='other_reference', + field=models.TextField(blank=True, null=True, verbose_name='Other reference'), + ), + migrations.AddField( + model_name='historicalarchaeologicalsite', + name='other_reference', + field=models.TextField(blank=True, null=True, verbose_name='Other reference'), + ), + ] diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 024886c72..81dd076a8 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -155,6 +155,7 @@ class ArchaeologicalSite(DocumentItem, BaseHistorizedItem, QRCodeItem, SearchVectorConfig("name"), SearchVectorConfig("oceanographic_service_localisation"), SearchVectorConfig("reference"), + SearchVectorConfig("other_reference"), SearchVectorConfig("shipwreck_code"), SearchVectorConfig("shipwreck_name"), SearchVectorConfig("drassm_number"), @@ -187,6 +188,10 @@ class ArchaeologicalSite(DocumentItem, BaseHistorizedItem, QRCodeItem, pgettext_lazy("key for text search", "name"), 'name__iexact' ), + 'other_reference': SearchAltName( + pgettext_lazy("key for text search", "other-reference"), + 'other_reference__iexact' + ), 'periods': SearchAltName( pgettext_lazy("key for text search", "period"), 'periods__label__iexact' @@ -283,6 +288,8 @@ class ArchaeologicalSite(DocumentItem, BaseHistorizedItem, QRCodeItem, objects = SiteManager() reference = models.CharField(_("Reference"), max_length=200, unique=True) + other_reference = models.TextField(_("Other reference"), blank=True, + null=True) name = models.CharField(_("Name"), max_length=200, null=True, blank=True) periods = models.ManyToManyField(Period, verbose_name=_("Periods"), diff --git a/archaeological_operations/templates/ishtar/sheet_site.html b/archaeological_operations/templates/ishtar/sheet_site.html index 91e6e7307..a69d61a13 100644 --- a/archaeological_operations/templates/ishtar/sheet_site.html +++ b/archaeological_operations/templates/ishtar/sheet_site.html @@ -33,12 +33,13 @@ <h3>{% trans "General"%}</h3> <div class="row"> - {% include "ishtar/blocks/sheet_creation_section.html" %} + {% field_flex "Other reference" item.other_reference %} {% field_flex_multiple_obj "Periods" item 'periods' %} {% field_flex_multiple_obj "Remains" item 'remains' %} {% field_flex_multiple_obj "Cultural attributions" item 'cultural_attributions' %} {% field_flex_multiple "Collaborators" item.collaborators %} {% field_flex_full "Comment" item.comment "<pre>" "</pre>" %} + {% include "ishtar/blocks/sheet_creation_section.html" %} </div> {% if item.affmar_number or item.drassm_number or item.oceanographic_service_localisation or item.shipwreck_code or item.sinking_date or item.discovery_area or item.shipwreck_name %} |