From 4b687f32fc3e09abd3777ba0db1fee821d4555d7 Mon Sep 17 00:00:00 2001 From: revelis-vincenzo Date: Wed, 15 Nov 2023 11:08:03 +0100 Subject: [PATCH] feat: cdswebsites object extra fix-migrations --- crud/cds_websites/forms.py | 16 +++-- .../templates/blocks/cds_website_page.html | 12 ++++ crud/cds_websites/templates/cds_website.html | 7 ++- .../templates/regulament_articles.html | 6 +- crud/cds_websites/templates/unique_form.html | 7 ++- crud/cds_websites/views.py | 60 +++++++++---------- ...iregolamento_sitowebcdstopicarticolireg.py | 2 +- .../migrations/0146_auto_20230712_1343.py | 2 +- ricerca_app/models.py | 4 +- 9 files changed, 70 insertions(+), 46 deletions(-) diff --git a/crud/cds_websites/forms.py b/crud/cds_websites/forms.py index 6eac5fd6..b6aa9f92 100644 --- a/crud/cds_websites/forms.py +++ b/crud/cds_websites/forms.py @@ -105,7 +105,6 @@ def __init__(self, *args, **kwargs): if self.initial: self.initial["visibile"] = bool(self.initial.get("visibile", None)) - visibile = forms.BooleanField( label=_("Visible"), required=False, @@ -146,7 +145,6 @@ def __init__(self, *args, **kwargs): class SitoWebCdsOggettiPortaleForm(forms.ModelForm): - id_classe_oggetto_portale = forms.ChoiceField( required=True, @@ -157,16 +155,25 @@ class SitoWebCdsOggettiPortaleForm(forms.ModelForm): required=True, min_value=1901, max_value=timezone.now().year, - label=_("Didactic Regulation Year"), + label=_("Didactic Regulation Academic Year"), ) id_oggetto_portale = forms.IntegerField( required=True, min_value=0, + label=_("Object Id"), ) class Meta: model = SitoWebCdsOggettiPortale exclude = ['dt_mod', 'id_user_mod','id_sito_web_cds_topic', 'cds', 'ordine', 'visibile'] - + labels = { + "titolo_it": _("Title (IT)"), + "titolo_en": _("Title (EN)"), + "testo_it": _("Text (IT)"), + "testo_en": _("Text (EN)"), + "id_oggetto_portale": _("Object Id"), + "aa_regdid_id": _("Didactic Regulation Academic Year"), + "id_classe_oggetto_portale": _("Object Class"), + } class SitoWebCdsTopicArticoliRegAltriDatiForm(forms.ModelForm): def __init__(self, *args, **kwargs): @@ -192,6 +199,7 @@ def __init__(self, *args, **kwargs): ) link = forms.URLField( label=_("Link"), + required=False, ) class Meta: diff --git a/crud/cds_websites/templates/blocks/cds_website_page.html b/crud/cds_websites/templates/blocks/cds_website_page.html index 237d144f..393bf7da 100644 --- a/crud/cds_websites/templates/blocks/cds_website_page.html +++ b/crud/cds_websites/templates/blocks/cds_website_page.html @@ -10,7 +10,11 @@
@@ -64,7 +68,11 @@