Skip to content

Commit

Permalink
Merge pull request #800 from gitnnolabs/fix_oaipmh_metadata
Browse files Browse the repository at this point in the history
Alterar para que collections contenha os ISSNs e communities contenha as coleções com o prefixo ``col``.
  • Loading branch information
gitnnolabs authored Jul 4, 2024
2 parents 8729a86 + b3f7552 commit 4affd1b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions article/search_indexes.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,21 +343,21 @@ def prepare_public(self, obj):
return True

def prepare_collections(self, obj):
"""The ISSN is on SciELO Journal models.SciELOJournal.objects.filter(journal=j)[0].issn_scielo"""
# set com os issns
if obj.journal:
return set([
j.issn_scielo for j in SciELOJournal.objects.filter(journal=obj.journal)
])

def prepare_communities(self, obj):
"""The collection field is multi-value, so may contain N collection.
IMPORTANT: the attribute of the ``obj`` is a property with a query which
can return no record that is very weak.
"""
if obj.collections:
if obj.collections:
return [col for col in obj.collections]

def prepare_communities(self, obj):
"""The ISSN is on SciELO Journal models.SciELOJournal.objects.filter(journal=j)[0].issn_scielo"""
# set com os issns
if obj.journal:
return set([
"com_%s" % j.issn_scielo for j in SciELOJournal.objects.filter(journal=obj.journal)
])
return ["col_%s" % col for col in obj.collections]

def prepare_titles(self, obj):
"""The list of titles."""
Expand Down

0 comments on commit 4affd1b

Please sign in to comment.