mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 08:39:24 +02:00
See #890: include notes in reports API representations
This commit is contained in:
parent
7a7cc55143
commit
eb5b63c008
3 changed files with 34 additions and 13 deletions
|
@ -1,8 +1,7 @@
|
|||
import urllib.parse
|
||||
import uuid
|
||||
|
||||
|
||||
from django.contrib.contenttypes.fields import GenericForeignKey
|
||||
from django.contrib.contenttypes.fields import GenericForeignKey, GenericRelation
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.contrib.postgres.fields import JSONField
|
||||
from django.db import models
|
||||
|
@ -149,6 +148,12 @@ class Report(federation_models.FederationMixin):
|
|||
# delete
|
||||
target_state = JSONField(null=True)
|
||||
|
||||
notes = GenericRelation(
|
||||
"Note",
|
||||
content_type_field="target_content_type",
|
||||
object_id_field="target_id",
|
||||
)
|
||||
|
||||
def get_federation_id(self):
|
||||
if self.fid:
|
||||
return self.fid
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue