Commit 6c862be3 authored by Sean Leavey's avatar Sean Leavey
Browse files

Merge branch 'authorid' into 'master'

Store authorid in DCCAuthor

See merge request !4
parents 9270065e 7f8bc149
Pipeline #362480 passed with stages
in 1 minute and 33 seconds
......@@ -139,7 +139,7 @@ class DCCXMLRecordParser(DCCParser):
except AttributeError:
enum = None
yield name, enum
yield name, enum, a.get("id")
@cached_property
def abstract(self):
......
......@@ -457,6 +457,7 @@ class DCCAuthor:
name: str
uid: int = None
authorid: int = None
def __str__(self):
return self.name
......@@ -869,7 +870,7 @@ class DCCRecord:
return DCCRecord(
dcc_number=parsed_dcc_number,
title=parsed.title,
authors=[DCCAuthor(name, uid) for name, uid in parsed.authors],
authors=[DCCAuthor(*auth) for auth in parsed.authors],
abstract=parsed.abstract,
keywords=parsed.keywords,
note=parsed.note,
......
__schema__ = "1"
title = "This is the title."
authors = [
{ name = "John Doe", uid = "123" },
{ name = "Jane Doe", uid = "321" },
{ name = "John Doe", uid = "456", authorid = "123" },
{ name = "Jane Doe", uid = "654", authorid = "321" },
]
abstract = "This is the abstract."
keywords = []
......
......@@ -12,13 +12,13 @@
<firstname>John</firstname>
<lastname>Doe</lastname>
<fullname>John Doe</fullname>
<employeenumber>123</employeenumber>
<employeenumber>456</employeenumber>
</author>
<author id="321">
<firstname>Jane</firstname>
<lastname>Doe</lastname>
<fullname>Jane Doe</fullname>
<employeenumber>321</employeenumber>
<employeenumber>654</employeenumber>
</author>
<topic id="18" parentid="1">
<name><![CDATA[System Engineering]]></name>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment