From 5f69b78737dc5c48bae3cb7991d0db1336bf1705 Mon Sep 17 00:00:00 2001 From: Samuel Veiga Rangel <82840278+samuelveigarangel@users.noreply.github.com> Date: Mon, 1 Jul 2024 02:47:19 -0300 Subject: [PATCH] =?UTF-8?q?Revert=20"Realiza=20adi=C3=A7=C3=B5es=20e=20alt?= =?UTF-8?q?era=C3=A7=C3=B5es=20no=20formul=C3=A1rio=20de=20Journal"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...6_editorialpolicy_opensciencecompliance.py | 183 ------------------ journal/models.py | 34 +--- 2 files changed, 3 insertions(+), 214 deletions(-) delete mode 100644 journal/migrations/0026_editorialpolicy_opensciencecompliance.py diff --git a/journal/migrations/0026_editorialpolicy_opensciencecompliance.py b/journal/migrations/0026_editorialpolicy_opensciencecompliance.py deleted file mode 100644 index 5b15f9c0..00000000 --- a/journal/migrations/0026_editorialpolicy_opensciencecompliance.py +++ /dev/null @@ -1,183 +0,0 @@ -# Generated by Django 5.0.3 on 2024-07-01 05:40 - -import django.db.models.deletion -import modelcluster.fields -import wagtail.fields -from django.conf import settings -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("core", "0003_gender_created_gender_creator_gender_updated_and_more"), - ("journal", "0025_journalurl.py"), - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ] - - operations = [ - migrations.CreateModel( - name="EditorialPolicy", - fields=[ - ( - "id", - models.BigAutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ( - "sort_order", - models.IntegerField(blank=True, editable=False, null=True), - ), - ( - "created", - models.DateTimeField( - auto_now_add=True, verbose_name="Creation date" - ), - ), - ( - "updated", - models.DateTimeField( - auto_now=True, verbose_name="Last update date" - ), - ), - ( - "rich_text", - wagtail.fields.RichTextField( - blank=True, null=True, verbose_name="Rich Text" - ), - ), - ( - "creator", - models.ForeignKey( - editable=False, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="%(class)s_creator", - to=settings.AUTH_USER_MODEL, - verbose_name="Creator", - ), - ), - ( - "journal", - modelcluster.fields.ParentalKey( - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="editorial_policy", - to="journal.journal", - ), - ), - ( - "language", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - to="core.language", - verbose_name="Idioma", - ), - ), - ( - "updated_by", - models.ForeignKey( - blank=True, - editable=False, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="%(class)s_last_mod_user", - to=settings.AUTH_USER_MODEL, - verbose_name="Updater", - ), - ), - ], - options={ - "ordering": ["sort_order"], - "abstract": False, - }, - ), - migrations.CreateModel( - name="OpenScienceCompliance", - fields=[ - ( - "id", - models.BigAutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ( - "sort_order", - models.IntegerField(blank=True, editable=False, null=True), - ), - ( - "created", - models.DateTimeField( - auto_now_add=True, verbose_name="Creation date" - ), - ), - ( - "updated", - models.DateTimeField( - auto_now=True, verbose_name="Last update date" - ), - ), - ( - "rich_text", - wagtail.fields.RichTextField( - blank=True, null=True, verbose_name="Rich Text" - ), - ), - ( - "creator", - models.ForeignKey( - editable=False, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="%(class)s_creator", - to=settings.AUTH_USER_MODEL, - verbose_name="Creator", - ), - ), - ( - "journal", - modelcluster.fields.ParentalKey( - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="open_science_compliance", - to="journal.journal", - ), - ), - ( - "language", - models.ForeignKey( - blank=True, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - to="core.language", - verbose_name="Idioma", - ), - ), - ( - "updated_by", - models.ForeignKey( - blank=True, - editable=False, - null=True, - on_delete=django.db.models.deletion.SET_NULL, - related_name="%(class)s_last_mod_user", - to=settings.AUTH_USER_MODEL, - verbose_name="Updater", - ), - ), - ], - options={ - "ordering": ["sort_order"], - "abstract": False, - }, - ), - ] diff --git a/journal/models.py b/journal/models.py index fef08f1d..5273017e 100755 --- a/journal/models.py +++ b/journal/models.py @@ -587,10 +587,10 @@ def autocomplete_label(self): panels_scope_and_about = [ AutocompletePanel("indexed_at"), AutocompletePanel("additional_indexed_at"), - AutocompletePanel("subject"), + FieldPanel("subject"), AutocompletePanel("subject_descriptor"), InlinePanel("thematic_area", label=_("Thematic Areas"), classname="collapsed"), - AutocompletePanel("wos_db"), + FieldPanel("wos_db"), AutocompletePanel("wos_area"), InlinePanel("mission", label=_("Mission"), classname="collapsed"), InlinePanel("history", label=_("Brief History"), classname="collapsed"), @@ -635,7 +635,6 @@ def autocomplete_label(self): InlinePanel("open_data", label=_("Open data"), classname="collapsed"), InlinePanel("preprint", label=_("Preprint"), classname="collapsed"), InlinePanel("review", label=_("Peer review"), classname="collapsed"), - InlinePanel("open_science_compliance", label=_("Open Science Compliance"), classname="collapsed"), ] panels_policy = [ @@ -695,11 +694,6 @@ def autocomplete_label(self): label=_("Fee Charging"), classname="collapsed", ), - InlinePanel( - "editorial_policy", - label=_("Editorial Policy"), - classname="collapsed", - ), ] panels_notes = [InlinePanel("annotation", label=_("Notes"), classname="collapsed")] @@ -1818,11 +1812,6 @@ class Subject(CommonControlField): code = models.CharField(max_length=30, null=True, blank=True) value = models.CharField(max_length=100, null=True, blank=True) - autocomplete_search_field = "value" - - def autocomplete_label(self): - return str(self) - def __str__(self): return f"{self.value}" @@ -1866,11 +1855,7 @@ def create_or_update( class WebOfKnowledge(CommonControlField): code = models.CharField(max_length=8, null=True, blank=True) value = models.CharField(max_length=100, null=True, blank=True) - - autocomplete_search_field = "value" - def autocomplete_label(self): - return str(self) def __str__(self): return f"{self.code} - {self.value}" @@ -2690,17 +2675,4 @@ def create_or_update( try: return cls.get(license_type=license_type) except cls.DoesNotExist: - return cls.create(user, license_type) - - -class EditorialPolicy(Orderable, RichTextWithLanguage, CommonControlField): - journal = ParentalKey( - Journal, on_delete=models.SET_NULL, related_name="editorial_policy", null=True - ) - - -class OpenScienceCompliance(Orderable, RichTextWithLanguage, CommonControlField): - journal = ParentalKey( - Journal, on_delete=models.SET_NULL, related_name="open_science_compliance", null=True - ) - + return cls.create(user, license_type) \ No newline at end of file