Skip to content

Commit

Permalink
Incluindo carga de áreas do WoS e bases do WoS onde o periódico é ind…
Browse files Browse the repository at this point in the history
…exado, #819
  • Loading branch information
fabiobatalha committed Jun 4, 2014
1 parent 6206e8e commit 62ef30f
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions scielomanager/tools/import_data/journalimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
from journalmanager.models import *


def capitalize(text):
text = str(text).lower()
return text[0].upper()+text[1:]


class JournalImport:

def __init__(self):
Expand Down Expand Up @@ -254,7 +259,7 @@ def load_use_license(self, code, disclaimer):

use_license = UseLicense.objects.get_or_create(license_code=code)[0]

if parsed_subfields_disclaimer.has_key('t'):
if 't' in parsed_subfields_disclaimer:
use_license.disclaimer = parsed_subfields_disclaimer['t']

use_license.save()
Expand Down Expand Up @@ -422,6 +427,15 @@ def load_journal(self, collection, user, loaded_sponsor, record):
if '64' in record:
journal.editor_email = record['64'][0]

if '851' in record:
journal.is_indexed_scie = True

if '852' in record:
journal.is_indexed_ssci = True

if '853' in record:
journal.is_indexed_aehci = True

journal.creator_id = user.pk
journal.collection = collection

Expand All @@ -431,6 +445,16 @@ def load_journal(self, collection, user, loaded_sponsor, record):

journal.sponsor = loaded_sponsor

if '854' in record:
for item in record['854']:
capitalized = ' '.join([capitalize(i.lower()) for i in item.split(' ')])
try:
area = SubjectCategory.objects.get(term=capitalized)
except:
print 'Subject Category not found (%s) for journal (%s)' % (capitalized, journal.title)

journal.subject_categories.add(area)

# created date
if '940' in record:
journal.created = self.iso_format(record['940'][0])
Expand Down Expand Up @@ -536,4 +560,4 @@ def get_conflicted_journals(self):
"""
Retorna a lista de revistas que já fazem parte do SciELO Manager e não puderam ser importadas.
"""
return self._conflicted_journals
return self._conflicted_journals

0 comments on commit 62ef30f

Please sign in to comment.