diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-02-09 18:02:41 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-02-28 12:15:24 +0100 |
commit | daed3aa1cdb63cea7ac97f1d7da838df465fc925 (patch) | |
tree | 64334c9307509607b65394e83ae0654f790f98cb /archaeological_finds | |
parent | 939918a683bff6a18cabcd83764e9db8dfd0183a (diff) | |
download | Ishtar-daed3aa1cdb63cea7ac97f1d7da838df465fc925.tar.bz2 Ishtar-daed3aa1cdb63cea7ac97f1d7da838df465fc925.zip |
Container: collection -> responsibility. Deactivate collection fot finds
Diffstat (limited to 'archaeological_finds')
-rw-r--r-- | archaeological_finds/forms.py | 60 | ||||
-rw-r--r-- | archaeological_finds/forms_treatments.py | 21 | ||||
-rw-r--r-- | archaeological_finds/models_finds.py | 12 | ||||
-rw-r--r-- | archaeological_finds/templates/ishtar/forms/qa_find_treatment.html | 2 | ||||
-rw-r--r-- | archaeological_finds/templates/ishtar/sheet_find.html | 2 |
5 files changed, 52 insertions, 45 deletions
diff --git a/archaeological_finds/forms.py b/archaeological_finds/forms.py index 4a93ffce4..58adb1de8 100644 --- a/archaeological_finds/forms.py +++ b/archaeological_finds/forms.py @@ -149,7 +149,7 @@ class BasicFindForm(CustomForm, ManageOldType): 'material_type_quality': models.MaterialTypeQualityType, 'object_type_quality': models.ObjectTypeQualityType, 'checked_type': models.CheckedType, - 'collection': Warehouse, + #'collection': Warehouse, } field_order = [ 'label', 'denomination', 'previous_id', 'museum_id', 'laboratory_id', @@ -175,12 +175,12 @@ class BasicFindForm(CustomForm, ManageOldType): laboratory_id = forms.CharField(label=_(u"Laboratory ID"), required=False) seal_number = forms.CharField(label=_(u"Seal number"), required=False) mark = forms.CharField(label=_(u"Mark"), required=False) - collection = forms.IntegerField( - label=_("Collection (warehouse)"), - widget=widgets.JQueryAutoComplete( - reverse_lazy('autocomplete-warehouse'), - associated_model=Warehouse, new=True), - validators=[valid_id(Warehouse)], required=False) + #collection = forms.IntegerField( + # label=_("Collection (warehouse)"), + # widget=widgets.JQueryAutoComplete( + # reverse_lazy('autocomplete-warehouse'), + # associated_model=Warehouse, new=True), + # validators=[valid_id(Warehouse)], required=False) HEADERS['description'] = FormHeader(_(u"Description")) description = forms.CharField(label=_(u"Description"), @@ -307,7 +307,7 @@ class FindForm(BasicFindForm): field_order = [ 'label', 'denomination', 'previous_id', 'get_first_base_find__excavation_id', 'museum_id', 'laboratory_id', - 'seal_number', 'mark', 'collection', 'description', + 'seal_number', 'mark', 'description', 'public_description', 'get_first_base_find__discovery_date', 'get_first_base_find__discovery_date_taq', 'get_first_base_find__batch', 'is_complete', 'material_type', 'material_type_quality', @@ -371,9 +371,9 @@ class FindForm(BasicFindForm): 'get_first_base_find__estimated_error_z', 'get_first_base_find__spatial_reference_system' ], - 'warehouse': [ - 'collection' - ] + #'warehouse': [ + # 'collection' + #] } def clean(self): @@ -590,7 +590,7 @@ class QAFindFormMulti(QAForm): REPLACE_FIELDS = [ 'qa_denomination', 'qa_ue', 'qa_manufacturing_place', 'qa_checked_type', 'qa_check_date', 'qa_conservatory_state', 'qa_treatment_emergency', - 'qa_appraisal_date', 'qa_collection', + 'qa_appraisal_date', # 'qa_collection', ] HEADERS = { @@ -625,12 +625,12 @@ class QAFindFormMulti(QAForm): required=False) qa_seal_number = forms.CharField(label=_(u"Seal number"), required=False) qa_mark = forms.CharField(label=_(u"Mark"), required=False) - qa_collection = forms.IntegerField( - label=_("Collection"), - widget=widgets.JQueryAutoComplete( - reverse_lazy('autocomplete-warehouse'), - associated_model=Warehouse), - validators=[valid_id(Warehouse)], required=False) + #qa_collection = forms.IntegerField( + # label=_("Collection"), + # widget=widgets.JQueryAutoComplete( + # reverse_lazy('autocomplete-warehouse'), + # associated_model=Warehouse), + # validators=[valid_id(Warehouse)], required=False) qa_description = forms.CharField( label=_(u"Description"), widget=forms.Textarea, required=False) @@ -692,12 +692,12 @@ class QAFindFormMulti(QAForm): return "" return value - def _get_qa_collection(self, value): - try: - value = Warehouse.objects.get(pk=value).name - except Warehouse.DoesNotExist: - return "" - return value + #def _get_qa_collection(self, value): + # try: + # value = Warehouse.objects.get(pk=value).name + # except Warehouse.DoesNotExist: + # return "" + # return value def _set_qa_ue(self, item, user): ue = self.cleaned_data['qa_ue'] @@ -1267,12 +1267,12 @@ class FindSelect(DocumentItemSelect, PeriodSelect): class FindSelectWarehouseModule(FindSelect): - collection = forms.IntegerField( - label=_("Collection (warehouse)"), - widget=widgets.JQueryAutoComplete( - reverse_lazy('autocomplete-warehouse'), - associated_model=Warehouse), - validators=[valid_id(Warehouse)]) + #collection = forms.IntegerField( + # label=_("Collection (warehouse)"), + # widget=widgets.JQueryAutoComplete( + # reverse_lazy('autocomplete-warehouse'), + # associated_model=Warehouse), + # validators=[valid_id(Warehouse)]) container = forms.IntegerField( label=_("Current container"), widget=widgets.JQueryAutoComplete( diff --git a/archaeological_finds/forms_treatments.py b/archaeological_finds/forms_treatments.py index ad4966e51..ac4420ce8 100644 --- a/archaeological_finds/forms_treatments.py +++ b/archaeological_finds/forms_treatments.py @@ -412,10 +412,11 @@ class QAFindTreatmentForm(IshtarForm): ('current', _("the current container")), ) ) - collection = forms.BooleanField( - label=_("Associate to the collection of the container"), required=False, - widget=widgets.CheckboxInput - ) + #collection = forms.BooleanField( + # label=_("Associate to the collection of the container"), + # required=False, + # widget=widgets.CheckboxInput + #) create_treatment = forms.BooleanField( label=_("Create a treatment"), required=False, widget=widgets.CheckboxInput @@ -531,14 +532,14 @@ class QAFindTreatmentForm(IshtarForm): container_attrs.append('container_ref') if container_to_change in ('current', 'current-and-reference'): container_attrs.append('container') - collection = None - if self.cleaned_data.get("collection"): - collection = container.location_id + #collection = None + #if self.cleaned_data.get("collection"): + # collection = container.location_id for find in items: changed = False - if collection and find.collection_id != collection: - find.collection_id = collection - changed = True + #if collection and find.collection_id != collection: + # find.collection_id = collection + # changed = True for container_attr in container_attrs: if getattr(find, container_attr) == container: continue diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index 9394a41d0..1bfe56708 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -1166,10 +1166,10 @@ class Find(BulkUpdatedItem, ValueGetter, DocumentItem, BaseHistorizedItem, SearchAltName( pgettext_lazy("key for text search", "previous-id"), 'previous_id__iexact'), - 'collection': - SearchAltName( - pgettext_lazy("key for text search", "collection"), - 'collection__name__iexact'), + #'collection': + # SearchAltName( + # pgettext_lazy("key for text search", "collection"), + # 'collection__name__iexact'), 'seal_number': SearchAltName( pgettext_lazy("key for text search", "seal-number"), @@ -1652,7 +1652,9 @@ class Find(BulkUpdatedItem, ValueGetter, DocumentItem, BaseHistorizedItem, null=True) collection = models.ForeignKey( "archaeological_warehouse.Warehouse", verbose_name=_("Collection"), - blank=True, null=True, related_name='finds', on_delete=models.SET_NULL) + blank=True, null=True, related_name='finds', on_delete=models.SET_NULL, + help_text=_("Do not use - need evolutions"), + ) # preservation module conservatory_state = models.ForeignKey( diff --git a/archaeological_finds/templates/ishtar/forms/qa_find_treatment.html b/archaeological_finds/templates/ishtar/forms/qa_find_treatment.html index e8d00cb33..8a6367c7e 100644 --- a/archaeological_finds/templates/ishtar/forms/qa_find_treatment.html +++ b/archaeological_finds/templates/ishtar/forms/qa_find_treatment.html @@ -30,11 +30,13 @@ {% endwith %} {% endwith %} </div> + {% comment %} <div class="form-row"> {{ form.collection }} <label for="{{form.collection.auto_id}}"> {% trans "Associate to the collection of the container" %} </label> </div> + {% endcomment %} <div class="form-row"> {{ form.create_treatment }} <label for="{{form.create_treatment.auto_id}}"> diff --git a/archaeological_finds/templates/ishtar/sheet_find.html b/archaeological_finds/templates/ishtar/sheet_find.html index 76dc14cd8..2a1cf595a 100644 --- a/archaeological_finds/templates/ishtar/sheet_find.html +++ b/archaeological_finds/templates/ishtar/sheet_find.html @@ -256,11 +256,13 @@ {% if display_warehouse_treatments %} <div class="tab-pane fade" id="{{window_id}}-warehouse" role="tabpanel" aria-labelledby="{{window_id}}-warehouse-tab"> + {% comment %} {% if item.collection %} <div class='row'> {% field_flex_detail "Collection" item.collection "large" %} </div> {% endif %} + {% endcomment %} {% if item.container or item.container_ref %} <h3>{% trans "Warehouse - container" %}</h3> <div class='row'> |