From 77ab299620f790627f4628595a2ad56c3c1fe192 Mon Sep 17 00:00:00 2001 From: Samuel Veiga Rangel Date: Fri, 22 Nov 2024 01:06:25 -0300 Subject: [PATCH 1/2] - Cria add_collab em AuxiliarArticleFactory - Chama funcao add_collab em ArticleFactory --- opac/webapp/factory.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/opac/webapp/factory.py b/opac/webapp/factory.py index a37882d9..ee5b310d 100644 --- a/opac/webapp/factory.py +++ b/opac/webapp/factory.py @@ -237,6 +237,7 @@ def __init__(self, doc_id, issue_id=None): self.doc.htmls = None self.doc.pdfs = None self.doc.mat_suppl_items = None + self.doc.collabs = None def add_identifiers(self, v2, aop_pid, other_pids=None): # Identificadores @@ -458,6 +459,14 @@ def publish_document(self, created, updated, is_public): raise PublishDocumentError(e) return self.doc + def add_collab(self, name): + # collabs = EmbeddedDocumentListField(Collab) + if self.doc.collabs is None: + self.doc.collabs = [] + _collab = models.Collab() + _collab.name = name + self.doc.collabs.append(_collab) + def ArticleFactory( document_id: str, @@ -570,6 +579,11 @@ def ArticleFactory( # add_doi_with_lang(self, language, doi) # add_related_article(self, doi, ref_id, related_type) factory.publish_document(data.get("created"), data.get("updated"), data.get("is_public")) + + for item in data.get("collab") or []: + factory.add_collab( + name=item.get("name") + ) return article From 0d39a75a7cf02a745e7d2f33e8823e489d178651 Mon Sep 17 00:00:00 2001 From: Samuel Veiga Rangel Date: Tue, 26 Nov 2024 09:55:20 -0300 Subject: [PATCH 2/2] Update opac_schema --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b0959687..782fbe92 100644 --- a/requirements.txt +++ b/requirements.txt @@ -94,6 +94,6 @@ zope.interface==5.5.2 tox==4.3.5 PyJWT==2.8.0 tenacity==8.2.3 --e git+https://git@github.com/scieloorg/opac_schema@v2.8.1#egg=Opac_Schema +-e git+https://git@github.com/scieloorg/opac_schema@v2.9.0#egg=Opac_Schema -e git+https://git@github.com/scieloorg/packtools@4.5.0#egg=packtools -e git+https://github.com/scieloorg/scieloh5m5.git@1.9.5#egg=scieloh5m5