Open robertatakenaka opened 11 months ago
from django.db.models import Q
q = None
for item in items:
if q is None:
q = Q(authors__surname=item["surname"], authors__given_names=item["given_names"])
else:
q = q & Q(author__surname=item["surname"], author__given_names=item["given_names"])
X.objects(q, **params)
Descrição da tarefa
Crear los modelos relacionados a referencias bibliográficas
En la app reference, complete el módulo models.py (https://github.com/scieloorg/core/blob/main/reference/models.py), de acuerdo con las instrucciones:
Deve contener los atributos:
Crear los
@classmethod
create_or_update e get e usar como parámetros:Consultar la combinación de estes 4 grupos (4 if)
Ej _ilustrativo (authors=authors y citations_ids=citationsids no van a funcionar pues es m2m):
Deve contener los atributos:
ref/@id
) (<ref id="B01">
, es decir, el valor deattrib_id
es B01) - CharField max_length=8Crear los
@classmethod
create_or_update e get e usar como parámetros:Ej.: pmid:
<pub-id pub-id-type="pmid">6772889</pub-id>
Nota: futuramente vamos a usar la classe ArticleCitations para obtener los datos de las citas de los XML y completar los registros. ~https://github.com/scieloorg/packtools/blob/2b4af9f53d18db96358acdc099cd62f888c23cb8/packtools/sps/models/article_citations.py#L80C7-L80C23~
https://github.com/scieloorg/packtools/blob/master/packtools/sps/models/article_citations.py#L96