Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,5 +301,18 @@
LLAMA_ENABLED = env.bool("LLAMA_ENABLED", default=True)
MODEL_LLAMA = "llama-3.2-3b-instruct-q4_k_m.gguf"

# Core API
CORE_API_DOMAIN = env("CORE_API_DOMAIN", default="https://core.scielo.org")
CORE_COLLECTION_API_ENDPOINT = env(
"CORE_COLLECTION_API_ENDPOINT",
default="/api/v2/pid/collection/",
)
CORE_JOURNAL_API_ENDPOINT = env(
"CORE_JOURNAL_API_ENDPOINT",
default="/api/v2/pid/journal/",
)
CORE_COLLECTION_API_URL = f"{CORE_API_DOMAIN}{CORE_COLLECTION_API_ENDPOINT}"
CORE_JOURNAL_API_URL = f"{CORE_API_DOMAIN}{CORE_JOURNAL_API_ENDPOINT}"

#Aumento en el límite de campos
DATA_UPLOAD_MAX_NUMBER_FIELDS = 10000
176 changes: 65 additions & 111 deletions markup_doc/choices.py
Original file line number Diff line number Diff line change
@@ -1,121 +1,75 @@
front_labels = [
('<abstract>', '<abstract>'),
('<abstract-title>', '<abstract-title>'),
('<aff>', '<aff>'),
('<article-id>', '<article-id>'),
('<article-title>', '<article-title>'),
('<author-notes>', '<author-notes>'),
('<contrib>', '<contrib>'),
('<date-accepted>', '<date-accepted>'),
('<date-received>', '<date-received>'),
('<fig>', '<fig>'),
('<fig-attrib>', '<fig-attrib>'),
('<history>', '<history>'),
('<kwd-title>', '<kwd-title>'),
('<kwd-group>', '<kwd-group>'),
('<list>', '<list>'),
('<p>', '<p>'),
('<sec>', '<sec>'),
('<sub-sec>', '<sub-sec>'),
('<subject>', '<subject>'),
('<table>', '<table>'),
('<table-foot>', '<table-foot>'),
('<title>', '<title>'),
('<trans-abstract>', '<trans-abstract>'),
('<trans-title>', '<trans-title>'),
('<translate-front>', '<translate-front>'),
('<translate-body>', '<translate-body>'),
('<disp-formula>', '<disp-formula>'),
('<inline-formula>', '<inline-formula>'),
('<formula>', '<formula>'),

("<abstract>", "<abstract>"),
("<abstract-title>", "<abstract-title>"),
("<aff>", "<aff>"),
("<article-id>", "<article-id>"),
("<article-title>", "<article-title>"),
("<author-notes>", "<author-notes>"),
("<contrib>", "<contrib>"),
("<date-accepted>", "<date-accepted>"),
("<date-received>", "<date-received>"),
("<fig>", "<fig>"),
("<fig-attrib>", "<fig-attrib>"),
("<history>", "<history>"),
("<kwd-title>", "<kwd-title>"),
("<kwd-group>", "<kwd-group>"),
("<list>", "<list>"),
("<p>", "<p>"),
("<sec>", "<sec>"),
("<sub-sec>", "<sub-sec>"),
("<subject>", "<subject>"),
("<table>", "<table>"),
("<table-foot>", "<table-foot>"),
("<title>", "<title>"),
("<trans-abstract>", "<trans-abstract>"),
("<trans-title>", "<trans-title>"),
("<translate-front>", "<translate-front>"),
("<translate-body>", "<translate-body>"),
("<disp-formula>", "<disp-formula>"),
("<inline-formula>", "<inline-formula>"),
("<formula>", "<formula>"),
]

order_labels = {
'<article-id>':{
'pos' : 1,
'next' : '<subject>'
},
'<subject>':{
'pos' : 2,
'next' : '<article-title>'
},
'<article-title>':{
'pos' : 3,
'next' : '<trans-title>',
'lan' : True
},
'<trans-title>':{
'size' : 14,
'bold' : True,
'lan' : True,
'next' : '<contrib>'
},
'<contrib>':{
'reset' : True,
'size' : 12,
'next' : '<aff>'
},
'<aff>':{
'reset' : True,
'size' : 12,
},
'<abstract>':{
'size' : 12,
'bold' : True,
'lan' : True,
'next' : '<p>'
},
'<p>':{
'size' : 12,
'next' : '<p>',
'repeat' : True
},
'<trans-abstract>':{
'size' : 12,
'bold' : True,
'lan' : True,
'next' : '<p>'
},
'<kwd-group>':{
'size' : 12,
'regex' : r'(?i)(palabra.*clave.*:|keyword.*:)',
},
'<history>':{
'size' : 12,
'regex' : r'\d{2}/\d{2}/\d{4}',
},
'<corresp>':{
'size' : 12,
'regex' : r'[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}'
},
'<sec>':{
'size' : 16,
'bold' : True,
'next' : None
},
'<sub-sec>':{
'size' : 12,
'italic' : True,
'next' : None
},
'<sub-sec-2>':{
'size' : 14,
'bold' : True,
'next' : None
},
"<article-id>": {"pos": 1, "next": "<subject>"},
"<subject>": {"pos": 2, "next": "<article-title>"},
"<article-title>": {"pos": 3, "next": "<trans-title>", "lan": True},
"<trans-title>": {"size": 14, "bold": True, "lan": True, "next": "<contrib>"},
"<contrib>": {"reset": True, "size": 12, "next": "<aff>"},
"<aff>": {
"reset": True,
"size": 12,
},
"<abstract>": {"size": 12, "bold": True, "lan": True, "next": "<p>"},
"<p>": {"size": 12, "next": "<p>", "repeat": True},
"<trans-abstract>": {"size": 12, "bold": True, "lan": True, "next": "<p>"},
"<kwd-group>": {
"size": 12,
"regex": r"(?i)(palabra.*clave.*:|keyword.*:)",
},
"<history>": {
"size": 12,
"regex": r"\d{2}/\d{2}/\d{4}",
},
"<corresp>": {
"size": 12,
"regex": r"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}",
},
"<sec>": {"size": 16, "bold": True, "next": None},
"<sub-sec>": {"size": 12, "italic": True, "next": None},
"<sub-sec-2>": {"size": 14, "bold": True, "next": None},
}

order_labels_body = {
'<sec>':{
'size' : 16,
'bold' : True,
"<sec>": {
"size": 16,
"bold": True,
},
'<sub-sec>':{
'size' : 12,
'italic' : True,
"<sub-sec>": {
"size": 12,
"italic": True,
},
'<p>':{
'size' : 12,
"<p>": {
"size": 12,
},
}
}
2 changes: 1 addition & 1 deletion markup_doc/forms.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from wagtail.admin.forms.models import WagtailAdminModelForm

24 changes: 17 additions & 7 deletions markup_doc/migrations/0002_alter_articledocx_estatus_and_more.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,28 @@
class Migration(migrations.Migration):

dependencies = [
('markup_doc', '0001_initial'),
("markup_doc", "0001_initial"),
]

operations = [
migrations.AlterField(
model_name='articledocx',
name='estatus',
field=models.IntegerField(blank=True, choices=[(1, 'Processing'), (2, 'Processed')], default=1, verbose_name='Process estatus'),
model_name="articledocx",
name="estatus",
field=models.IntegerField(
blank=True,
choices=[(1, "Processing"), (2, "Processed")],
default=1,
verbose_name="Process estatus",
),
),
migrations.AlterField(
model_name='articledocxmarkup',
name='estatus',
field=models.IntegerField(blank=True, choices=[(1, 'Processing'), (2, 'Processed')], default=1, verbose_name='Process estatus'),
model_name="articledocxmarkup",
name="estatus",
field=models.IntegerField(
blank=True,
choices=[(1, "Processing"), (2, "Processed")],
default=1,
verbose_name="Process estatus",
),
),
]
Loading
Loading