Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix editors and authors
  • Loading branch information
mvogl committed Aug 2, 2017
1 parent 590d407 commit 392d3d0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
1 change: 1 addition & 0 deletions eoa/tests.py
Expand Up @@ -110,6 +110,7 @@ def testCit(self):
cit1 = Citation.objects.get(idstring = 'Mop1909')
self.assertEqual(aut1.citations.get(pk = cit1.pk),cit1)
self.assertEqual(cit1.__str__(), 'Mop1909: Testing citations')
print(cit1.citauthors.all())


class MixedContentModelTest(TestCase):
Expand Down
28 changes: 13 additions & 15 deletions publications/management/commands/_importer_class.py
Expand Up @@ -269,7 +269,7 @@ def createParagraphs(text,publication):
print(parent)
pass
except:
print('Could not find parent element of: {0}'.format(paragraph))
#print('Could not find parent element of: {0}'.format(paragraph))
pass
parList.append(paraTemp)
return parList
Expand All @@ -282,20 +282,18 @@ def createCitations(text,publication):
citTemp, created = Citation.objects.update_or_create(
**cit
)
for author in aut:
if type(author)==dict:
autTemp, created = Author.objects.update_or_create(
**author
)
autTemp.citations.add(citTemp)
autList.append(autTemp)
for editor in edi:
if type(editor)==dict:
ediTemp, created = Author.objects.update_or_create(
**editor
)
ediTemp.editions.add(citTemp)
ediList.append(ediTemp)
for author in aut[1]:
autTemp, created = Author.objects.update_or_create(
**author
)
autTemp.citations.add(citTemp)
autList.append(autTemp)
for editor in edi[1]:
ediTemp, created = Author.objects.update_or_create(
**editor
)
ediTemp.editions.add(citTemp)
ediList.append(ediTemp)
return (autList,ediList,cit)
# print(cit['author'])
# try:
Expand Down

0 comments on commit 392d3d0

Please sign in to comment.