diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-05-14 16:02:33 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2021-02-28 12:15:20 +0100 |
commit | 5fa2a1d83d08fe47ce8285d3d350b5d5da103edd (patch) | |
tree | 63d6dbce538def79fc2a007a6c841427ede69a05 /ishtar_common/forms_common.py | |
parent | cbd38f88d2fa64f29ac2ee8eac73bdc2c0377cb2 (diff) | |
download | Ishtar-5fa2a1d83d08fe47ce8285d3d350b5d5da103edd.tar.bz2 Ishtar-5fa2a1d83d08fe47ce8285d3d350b5d5da103edd.zip |
Documents - add format, scale, associated containers
Diffstat (limited to 'ishtar_common/forms_common.py')
-rw-r--r-- | ishtar_common/forms_common.py | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py index df8535240..70204fbd7 100644 --- a/ishtar_common/forms_common.py +++ b/ishtar_common/forms_common.py @@ -1235,7 +1235,9 @@ class DocumentForm(forms.ModelForm, CustomForm, ManageOldType): form_slug = "document-general" file_upload = True extra_form_modals = ["author", "person", "organization"] - associated_models = {'source_type': models.SourceType} + associated_models = {'source_type': models.SourceType, + 'support_type': models.SupportType, + 'format_type': models.Format} pk = forms.IntegerField(label="", required=False, widget=forms.HiddenInput) title = forms.CharField(label=_("Title"), required=False, @@ -1243,6 +1245,19 @@ class DocumentForm(forms.ModelForm, CustomForm, ManageOldType): source_type = widgets.ModelChoiceField( model=models.SourceType, label=_("Source type"), choices=[], required=False) + support_type = widgets.ModelChoiceField( + model=models.SupportType, label=_("Support"), choices=[], + required=False) + format_type = widgets.ModelChoiceField( + model=models.Format, label=_("Format"), choices=[], + required=False) + scale = forms.CharField(label=_("Scale"), max_length=30, required=False) + container = widgets.ModelJQueryAutocompleteField( + label=_("Current container"), + model=Container, required=False) + container_ref = widgets.ModelJQueryAutocompleteField( + label=_("Reference container"), + model=Container, required=False) authors = widgets.ModelJQueryAutocompleteField( model=models.Author, multiple=True, label=_("Authors"), new=True, long_widget=True, required=False) @@ -1284,23 +1299,29 @@ class DocumentForm(forms.ModelForm, CustomForm, ManageOldType): TYPES = [ FieldType('source_type', models.SourceType), + FieldType('support_type', models.SupportType), + FieldType('format_type', models.Format), ] class Meta: model = models.Document fields = [ 'title', 'source_type', 'reference', 'internal_reference', + 'format_type', 'support_type', 'scale', 'image', 'associated_file', 'associated_url', 'authors', 'receipt_date', 'receipt_date_in_documentation', 'creation_date', + 'container', "container_ref", 'comment', 'description', 'additional_information', 'duplicate' ] HEADERS = { 'title': FormHeader(_("Identification")), + 'format_type': FormHeader(_("Format")), 'image': FormHeader(_("Content")), 'authors': FormHeader(_("Authors")), 'receipt_date': FormHeader(_("Dates")), + 'container': FormHeader(_("Container"), collapse=True), 'comment': FormHeader(_("Advanced"), collapse=True), 'finds': FormHeader(_("Related items")), } |