Skip to content

Commit

Permalink
Merge pull request #821 from fabiobatalha/tk819
Browse files Browse the repository at this point in the history
Incluindo carga de áreas do WoS e bases do WoS onde o periódico é indexado
  • Loading branch information
fabiobatalha committed Jun 9, 2014
2 parents 6af08e1 + cd4bf31 commit fc8c9aa
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions scielomanager/tools/import_data/journalimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@
from journalmanager.models import *


def capitalize(text):

text = ' '.join([i.capitalize() for i in str(text).lower().split(' ')])

return text


class JournalImport:

def __init__(self):
Expand Down Expand Up @@ -254,7 +261,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 +429,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 +447,16 @@ def load_journal(self, collection, user, loaded_sponsor, record):

journal.sponsor = loaded_sponsor

if '854' in record:
for item in record['854']:
capitalized = capitalize(item)
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 +562,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 fc8c9aa

Please sign in to comment.