mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 08:39:16 +02:00
See #890: tweaks / perf improvements
This commit is contained in:
parent
b363d1117c
commit
7a7cc55143
6 changed files with 56 additions and 34 deletions
22
api/funkwhale_api/moderation/utils.py
Normal file
22
api/funkwhale_api/moderation/utils.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
|
||||
from rest_framework import serializers
|
||||
|
||||
from funkwhale_api.federation import models as federation_models
|
||||
|
||||
from . import models
|
||||
from . import serializers as moderation_serializers
|
||||
|
||||
|
||||
NOTE_TARGET_FIELDS = {
|
||||
"report": {
|
||||
"queryset": models.Report.objects.all(),
|
||||
"id_attr": "uuid",
|
||||
"id_field": serializers.UUIDField(),
|
||||
},
|
||||
"account": {
|
||||
"queryset": federation_models.Actor.objects.all(),
|
||||
"id_attr": "full_username",
|
||||
"id_field": serializers.EmailField(),
|
||||
"get_query": moderation_serializers.get_actor_query,
|
||||
},
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue