diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-10-29 13:07:28 +0100 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-10-29 17:15:38 +0100 |
| commit | 3294e42914759e9279d725c35a6ffdbcec45050e (patch) | |
| tree | 6912489bb321bab15c39e6cdf6aacd67ae46e039 /archaeological_finds/forms.py | |
| parent | aa54dab9fdff35273dc1b64a772bef4ffb195250 (diff) | |
| download | Ishtar-3294e42914759e9279d725c35a6ffdbcec45050e.tar.bz2 Ishtar-3294e42914759e9279d725c35a6ffdbcec45050e.zip | |
🚧 datings refactoringdevelop-5.0
Diffstat (limited to 'archaeological_finds/forms.py')
| -rw-r--r-- | archaeological_finds/forms.py | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/archaeological_finds/forms.py b/archaeological_finds/forms.py index 0cabfd53a..9890387b1 100644 --- a/archaeological_finds/forms.py +++ b/archaeological_finds/forms.py @@ -129,7 +129,6 @@ __all__ = [ "FindForm", "SimpleFindForm", "DateForm", - "DatingFormSet", "PreservationForm", "FindBasketFormSelection", "FindBasketForWriteFormSelection", @@ -240,6 +239,7 @@ class BasicFindForm(MuseumForm, CustomForm, ManageOldType): form_slug = "find-020-simplegeneral" base_models = [ "object_type", + "period", "material_type", "communicabilitie", "cultural_attribution", @@ -256,6 +256,7 @@ class BasicFindForm(MuseumForm, CustomForm, ManageOldType): "material_type": models.MaterialType, "cultural_attribution": CulturalAttributionType, "object_type": models.ObjectType, + "period": Period, "functional_area": models.FunctionalArea, "technical_area": models.TechnicalAreaType, "technical_processe": models.TechnicalProcessType, @@ -330,6 +331,7 @@ class BasicFindForm(MuseumForm, CustomForm, ManageOldType): "communicabilitie", "comment", "cultural_attribution", + "period", "dating_comment", "length", "width", @@ -519,6 +521,10 @@ class BasicFindForm(MuseumForm, CustomForm, ManageOldType): label=_("Cultural attribution"), required=False, ) + period = widgets.Select2MultipleField( + label=_("Periods"), + required=False, + ) dating_comment = forms.CharField( label=_("Comment on dating"), required=False, widget=forms.Textarea ) @@ -579,6 +585,7 @@ class BasicFindForm(MuseumForm, CustomForm, ManageOldType): extra_args={"full_hierarchy": True}, ), FieldType("cultural_attribution", CulturalAttributionType, is_multiple=True), + FieldType("period", Period, is_multiple=True), FieldType("material_type_quality", models.MaterialTypeQualityType), FieldType( "object_type", @@ -708,8 +715,9 @@ class FindForm(BasicFindForm): "decoration", "manufacturing_place", "communicabilitie", - "comment", "cultural_attribution", + "comment", + "period", "dating_comment", "length", "width", @@ -1610,12 +1618,6 @@ class DateForm(ManageOldType, forms.Form): ] -DatingFormSet = formset_factory(DateForm, can_delete=True, formset=FormSet) -DatingFormSet.form_label = _("Dating") -DatingFormSet.form_admin_name = _("Find - 040 - Dating") -DatingFormSet.form_slug = "find-040-dating" - - class FindSelect(MuseumForm, GeoItemSelect, PeriodSelect): _model = models.Find form_admin_name = _("Find - 001 - Search") @@ -1907,6 +1909,9 @@ class FindSelect(MuseumForm, GeoItemSelect, PeriodSelect): cultural_attributions = forms.ChoiceField( label=_("Cultural attribution"), choices=[], required=False ) + periods = forms.ChoiceField( + label=_("Periods"), choices=[], required=False + ) dating_comment = forms.CharField(label=_("Comment on dating")) length = FloatField(label=_("Length (cm)"), widget=widgets.CentimeterMeterWidget) @@ -2015,6 +2020,7 @@ class FindSelect(MuseumForm, GeoItemSelect, PeriodSelect): museum_purchase_price = forms.CharField(label=_("Museum - Purchase price")) TYPES = PeriodSelect.TYPES + [ + FieldType("periods", Period), FieldType("conservatory_states", models.ConservatoryState), FieldType("base_finds__batch", models.BatchType), FieldType("recommended_treatments", models.RecommendedTreatmentType), |
