1
0
Fork 0

Updates to_model to use fields

This commit is contained in:
Mouse Reeve 2020-12-03 12:35:57 -08:00
parent 1610d81ce6
commit a85043b351
7 changed files with 78 additions and 66 deletions

View file

@ -80,7 +80,9 @@ class ActivitypubMixin:
activity[key] += value
else:
activity[key] = value
if hasattr(self, 'serialize_reverse_fields'):
# for example, editions of a work
for field_name in self.serialize_reverse_fields:
related_field = getattr(self, field_name)
activity[field_name] = unfurl_related_field(related_field)