Skip to content

Commit

Permalink
Garante que seja apresentado preferencialmente o elocation e a primei…
Browse files Browse the repository at this point in the history
…ra pagina e última pagina no atributo page. Corrigi teste e adiciona novos testes para as últimas mudanças no atributo page.
  • Loading branch information
gitnnolabs committed Feb 23, 2023
1 parent 4cb26ee commit dfca52f
Show file tree
Hide file tree
Showing 3 changed files with 185 additions and 6 deletions.
11 changes: 10 additions & 1 deletion opac_schema/v1/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -924,6 +924,15 @@ def csl_json(self, site_domain="https://www.scielo.br"):

data_parts = [self.issue.year, month] if month else [self.issue.year]

fpage_lpage = []
if self.fpage != '' and self.fpage:
fpage_lpage.append(self.fpage)

if self.lpage != '' and self.lpage:
fpage_lpage.append(self.lpage)

page = self.elocation if self.elocation else "-".join(fpage_lpage)

return [
{
"id": self._id,
Expand All @@ -941,7 +950,7 @@ def csl_json(self, site_domain="https://www.scielo.br"):
data_parts
]
},
"page": self.elocation,
"page": page,
"publisher": self.journal.publisher_name,
"title": self.title,
"type": "article-journal", # This must in future equalize with https://github.com/scieloorg/scielo_publishing_schema/blob/master/docs/source/tagset/elemento-article.rst and https://github.com/citation-style-language/schema/wiki/Data-Model-and-Mappings
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name="Opac Schema",
version='2.65',
version='2.66',
description="Schema of SciELO OPAC",
author="SciELO",
author_email="[email protected]",
Expand Down
Loading

0 comments on commit dfca52f

Please sign in to comment.