Closed mmaelicke closed 1 year ago
Should be solvable similar to the solution in #244, which fixed #236
@AlexDo1 I would close this without implementing it, as this is actually not a bug. The PersonAssociation
further relates the PersonRoles
. If we directly load the Person
, we loose the information on the role with which the person is related to the Entry
.
However, accessing the persons is trivial:
[pa.person for pa in entry.contributors]
returns a list Persons
.
A drawback is, that the PersonAssociation.to_dict
method always includes the Entry
. We could change that to only inlcude the Entry if deep=True
. Then this code would produce better output:
[pa.to_dict() for pa in entry.contributors]
[{
"person": `Person`,
"role": `PersonRole`,
"order": `Number`
}]
Yes that's good.
The fact Persons
are still easily accessible through PersonAssociation.person
solves the issue for me.
The changes to PersonAssociation.to_dict
to only include the Entry
with deep=True
would still be nice..
I just found out that,
Entry.contributors
stills returnsPersonAssociations
instead ofPerson
objects:Originally posted by @AlexDo1 in https://github.com/VForWaTer/metacatalog/issues/248#issuecomment-1410333968