Skip to content

Commit 4104f00

Browse files
Adiciona Métricas de Estatísticas de Peer Review (#1225)
* chore(deps): Adiciona wagtail-rangefilter e atualiza packtools para 4.13.1 * feat: Adiciona campos de estatísticas de peer review ao Article e cria ArticlePeerReviewStats * feat: Adiciona função para extrair e carregar datas e estatísticas de peer review do XML * feat: Registra ArticlePeerReviewStatsSnippetViewSet com filtros de range numérico * Adiciona migracao de article que adiciona números de peer_review * Remove wagtail-rangefilter dependency from requirements - Remove wagtail-rangefilter==1.3.0 from base requirements - No longer needed for filtering functionality * Refactor ArticlePeerReviewStats to remove NumericRangeFilter - Remove import of NumericRangeFilter from wagtail_rangefilter - Replace NumericRangeFilter with standard filters for date range fields - Update list_display to show pid_v3 and pid_v2 instead of journal and issue - Simplify filter configuration for days calculation fields * Corrige ArticlePeerReviewStats.get_queryset * feat: Remove estimative days fields and add is_new_public index to Article model * Update article/models.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Adiciona article/migrations/0044_alter_article_accepted_dateiso_and_more.py --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 71ecddb commit 4104f00

7 files changed

Lines changed: 486 additions & 2 deletions
Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
# Generated by Django 5.2.7 on 2025-11-18 01:58
2+
3+
from django.conf import settings
4+
from django.db import migrations, models
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
("article", "0041_relatedarticle"),
11+
("core", "0008_exportdestination"),
12+
("doi", "0003_alter_doi_created_alter_doi_creator_and_more"),
13+
("issue", "0021_tableofcontents_journal_toc_and_more"),
14+
("journal", "0054_journaltableofcontents"),
15+
(
16+
"pid_provider",
17+
"0014_remove_xmlversion_pid_provide_pid_pro_91cb7b_idx_and_more",
18+
),
19+
(
20+
"researcher",
21+
"0009_alter_affiliation_created_alter_affiliation_creator_and_more",
22+
),
23+
("vocabulary", "0005_alter_keyword_created_alter_keyword_creator_and_more"),
24+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
25+
]
26+
27+
operations = [
28+
migrations.CreateModel(
29+
name="ArticlePeerReviewStats",
30+
fields=[],
31+
options={
32+
"verbose_name": "Peer Review Stats",
33+
"verbose_name_plural": "Peer Review Stats",
34+
"proxy": True,
35+
"indexes": [],
36+
"constraints": [],
37+
},
38+
bases=("article.article",),
39+
),
40+
migrations.AddField(
41+
model_name="article",
42+
name="accepted_dateiso",
43+
field=models.CharField(blank=True, max_length=10, null=True),
44+
),
45+
migrations.AddField(
46+
model_name="article",
47+
name="days_accepted_to_published",
48+
field=models.IntegerField(blank=True, null=True),
49+
),
50+
migrations.AddField(
51+
model_name="article",
52+
name="days_accepted_to_published_estimated",
53+
field=models.BooleanField(blank=True, null=True),
54+
),
55+
migrations.AddField(
56+
model_name="article",
57+
name="days_preprint_to_published",
58+
field=models.IntegerField(blank=True, null=True),
59+
),
60+
migrations.AddField(
61+
model_name="article",
62+
name="days_preprint_to_published_estimated",
63+
field=models.BooleanField(blank=True, null=True),
64+
),
65+
migrations.AddField(
66+
model_name="article",
67+
name="days_preprint_to_received",
68+
field=models.IntegerField(blank=True, null=True),
69+
),
70+
migrations.AddField(
71+
model_name="article",
72+
name="days_preprint_to_received_estimated",
73+
field=models.BooleanField(blank=True, null=True),
74+
),
75+
migrations.AddField(
76+
model_name="article",
77+
name="days_receive_to_published",
78+
field=models.IntegerField(blank=True, null=True),
79+
),
80+
migrations.AddField(
81+
model_name="article",
82+
name="days_receive_to_published_estimated",
83+
field=models.BooleanField(blank=True, null=True),
84+
),
85+
migrations.AddField(
86+
model_name="article",
87+
name="days_received_to_accepted",
88+
field=models.IntegerField(blank=True, null=True),
89+
),
90+
migrations.AddField(
91+
model_name="article",
92+
name="days_received_to_accepted_estimated",
93+
field=models.BooleanField(blank=True, null=True),
94+
),
95+
migrations.AddField(
96+
model_name="article",
97+
name="peer_review_stats",
98+
field=models.JSONField(
99+
blank=True,
100+
default=dict,
101+
help_text="Todas as datas e intervalos do processo de revisão por pares",
102+
verbose_name="Peer review statistics",
103+
),
104+
),
105+
migrations.AddField(
106+
model_name="article",
107+
name="preprint_dateiso",
108+
field=models.CharField(blank=True, max_length=10, null=True),
109+
),
110+
migrations.AddField(
111+
model_name="article",
112+
name="received_dateiso",
113+
field=models.CharField(blank=True, max_length=10, null=True),
114+
),
115+
migrations.AddIndex(
116+
model_name="article",
117+
index=models.Index(
118+
fields=["article_type"], name="article_art_article_6e1e55_idx"
119+
),
120+
),
121+
migrations.AddIndex(
122+
model_name="article",
123+
index=models.Index(
124+
fields=["days_preprint_to_received"],
125+
name="article_art_days_pr_6211e7_idx",
126+
),
127+
),
128+
migrations.AddIndex(
129+
model_name="article",
130+
index=models.Index(
131+
fields=["days_received_to_accepted"],
132+
name="article_art_days_re_a672fb_idx",
133+
),
134+
),
135+
migrations.AddIndex(
136+
model_name="article",
137+
index=models.Index(
138+
fields=["days_accepted_to_published"],
139+
name="article_art_days_ac_75464d_idx",
140+
),
141+
),
142+
migrations.AddIndex(
143+
model_name="article",
144+
index=models.Index(
145+
fields=["days_preprint_to_published"],
146+
name="article_art_days_pr_cc0d64_idx",
147+
),
148+
),
149+
migrations.AddIndex(
150+
model_name="article",
151+
index=models.Index(
152+
fields=["days_receive_to_published"],
153+
name="article_art_days_re_c96316_idx",
154+
),
155+
),
156+
migrations.AddIndex(
157+
model_name="article",
158+
index=models.Index(
159+
fields=["days_preprint_to_received_estimated"],
160+
name="article_art_days_pr_ac8340_idx",
161+
),
162+
),
163+
migrations.AddIndex(
164+
model_name="article",
165+
index=models.Index(
166+
fields=["days_received_to_accepted_estimated"],
167+
name="article_art_days_re_46895c_idx",
168+
),
169+
),
170+
migrations.AddIndex(
171+
model_name="article",
172+
index=models.Index(
173+
fields=["days_accepted_to_published_estimated"],
174+
name="article_art_days_ac_158637_idx",
175+
),
176+
),
177+
migrations.AddIndex(
178+
model_name="article",
179+
index=models.Index(
180+
fields=["days_preprint_to_published_estimated"],
181+
name="article_art_days_pr_18a699_idx",
182+
),
183+
),
184+
migrations.AddIndex(
185+
model_name="article",
186+
index=models.Index(
187+
fields=["days_receive_to_published_estimated"],
188+
name="article_art_days_re_85fc4a_idx",
189+
),
190+
),
191+
]
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Generated by Django 5.2.7 on 2025-11-18 11:47
2+
3+
from django.conf import settings
4+
from django.db import migrations, models
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
("article", "0042_articlepeerreviewstats_article_accepted_dateiso_and_more"),
11+
("core", "0008_exportdestination"),
12+
("doi", "0003_alter_doi_created_alter_doi_creator_and_more"),
13+
("issue", "0021_tableofcontents_journal_toc_and_more"),
14+
("journal", "0054_journaltableofcontents"),
15+
(
16+
"pid_provider",
17+
"0014_remove_xmlversion_pid_provide_pid_pro_91cb7b_idx_and_more",
18+
),
19+
(
20+
"researcher",
21+
"0009_alter_affiliation_created_alter_affiliation_creator_and_more",
22+
),
23+
("vocabulary", "0005_alter_keyword_created_alter_keyword_creator_and_more"),
24+
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
25+
]
26+
27+
operations = [
28+
migrations.RemoveIndex(
29+
model_name="article",
30+
name="article_art_days_pr_ac8340_idx",
31+
),
32+
migrations.RemoveIndex(
33+
model_name="article",
34+
name="article_art_days_re_46895c_idx",
35+
),
36+
migrations.RemoveIndex(
37+
model_name="article",
38+
name="article_art_days_ac_158637_idx",
39+
),
40+
migrations.RemoveIndex(
41+
model_name="article",
42+
name="article_art_days_pr_18a699_idx",
43+
),
44+
migrations.AddIndex(
45+
model_name="article",
46+
index=models.Index(
47+
fields=["is_new_public"], name="article_art_is_new__90659e_idx"
48+
),
49+
),
50+
]
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Generated by Django 5.2.7 on 2025-11-18 12:38
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("article", "0043_remove_article_article_art_days_pr_ac8340_idx_and_more"),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name="article",
15+
name="accepted_dateiso",
16+
field=models.CharField(
17+
blank=True,
18+
help_text="Date the article was accepted, in ISO format (YYYY-MM-DD)",
19+
max_length=10,
20+
null=True,
21+
verbose_name="Accepted Date (ISO)",
22+
),
23+
),
24+
migrations.AlterField(
25+
model_name="article",
26+
name="preprint_dateiso",
27+
field=models.CharField(
28+
blank=True,
29+
help_text="Preprint publication date in ISO format (YYYY-MM-DD)",
30+
max_length=10,
31+
null=True,
32+
verbose_name="Preprint Date (ISO)",
33+
),
34+
),
35+
migrations.AlterField(
36+
model_name="article",
37+
name="received_dateiso",
38+
field=models.CharField(
39+
blank=True,
40+
help_text="Date the article was received, in ISO format (YYYY-MM-DD)",
41+
max_length=10,
42+
null=True,
43+
verbose_name="Received Date (ISO)",
44+
),
45+
),
46+
]

0 commit comments

Comments
 (0)