Skip to content

Commit

Permalink
Merge pull request #672 from upconsulting/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
jdamerow authored Dec 21, 2020
2 parents 8512a0d + ea7bf86 commit 18f056d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions isiscb/isiscb/local_postgresql_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@
PERSON_DEATH_DATE_ATTRIBUTE = os.environ.get('PERSON_BIRTH_DATE_ATTRIBUTE', "Death date")
PERSON_BIRTH_DEATH_DATE_ATTRIBUTE = os.environ.get('PERSON_BIRTH_DATE_ATTRIBUTE', "BirthToDeathDates")

COUNTRY_CODE_ATTRIBUTE = os.environ.get('COUNTRY_CODE_ATTRIBUTE', "CountryCode")

DATASET_ISISCB_NAME_PREFIX = os.environ.get('DATASET_ISISCB_NAME_PREFIX', 'Isis Bibliography of the History of Science')
DATASET_ISISCB_NAME_DISPLAY = os.environ.get('DATASET_ISISCB_NAME_DISPLAY', 'Isis Bibliography of the History of Science')
DATASET_SHOT_NAME_PREFIX = os.environ.get('DATASET_SHOT_NAME_PREFIX', 'Technology & Culture Bibliography')
Expand Down
2 changes: 2 additions & 0 deletions isiscb/isiscb/production_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,8 @@
RECORD_SUBTYPE_ATTRIBUTE = os.environ.get('RECORD_SUBTYPE_ATTRIBUTE', "RecordSubType")
ACCESSED_ATTRIBUTE_NAME = os.environ.get('ACCESSED_ATTRIBUTE_NAME', "LastAccessedDate")

COUNTRY_CODE_ATTRIBUTE = os.environ.get('COUNTRY_CODE_ATTRIBUTE', "CountryCode")

DOI_LINKED_DATA_NAME = os.environ.get('DOI_LINKED_DATA_NAME', "DOI")
ISBN_LINKED_DATA_NAME = os.environ.get('ISBN_LINKED_DATA_NAME', "ISBN")
URL_LINKED_DATA_NAME = os.environ.get('URL_LINKED_DATA_NAME', "URL")
Expand Down
2 changes: 2 additions & 0 deletions isiscb/isiscb/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,8 @@
PERSON_DEATH_DATE_ATTRIBUTE = os.environ.get('PERSON_BIRTH_DATE_ATTRIBUTE', "Death date")
PERSON_BIRTH_DEATH_DATE_ATTRIBUTE = os.environ.get('PERSON_BIRTH_DATE_ATTRIBUTE', "BirthToDeathDates")

COUNTRY_CODE_ATTRIBUTE = os.environ.get('COUNTRY_CODE_ATTRIBUTE', "CountryCode")

DATASET_ISISCB_NAME_PREFIX = os.environ.get('DATASET_ISISCB_NAME_PREFIX', 'Isis Bibliography of the History of Science')
DATASET_ISISCB_NAME_DISPLAY = os.environ.get('DATASET_ISISCB_NAME_DISPLAY', 'Isis Bibliography of the History of Science')
DATASET_SHOT_NAME_PREFIX = os.environ.get('DATASET_SHOT_NAME_PREFIX', 'Technology & Culture Bibliography')
Expand Down
7 changes: 7 additions & 0 deletions isiscb/isisdata/search_indexes.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ class CitationIndex(indexes.SearchIndex, indexes.Indexable):

geographics = indexes.MultiValueField(faceted=True, indexed=False)
geographic_ids = indexes.MultiValueField(faceted=True, indexed=False, null=True)
geocodes = indexes.MultiValueField(faceted=True, indexed=False, null=True)

cross_references = indexes.MultiValueField(faceted=True, indexed=False)
cross_references_ids = indexes.MultiValueField(faceted=True, indexed=False, null=True)
Expand Down Expand Up @@ -298,6 +299,12 @@ def prepare(self, obj):
elif a['acrelation__authority__type_controlled'] == Authority.GEOGRAPHIC_TERM:
multivalue_data['geographics'].append(name)
multivalue_data['geographic_ids'].append(ident)
authority = Authority.objects.get(pk=ident)
for attr in authority.attributes.all():
if attr.type_controlled.name == settings.COUNTRY_CODE_ATTRIBUTE:
country_codes = attr.value.display.split(",")
for code in country_codes:
multivalue_data['geocodes'].append(code.strip())
else:
if a['acrelation__authority__type_controlled'] == Authority.INSTITUTION:
multivalue_data['subject_institutions'].append(name)
Expand Down

0 comments on commit 18f056d

Please sign in to comment.