mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-03 22:19:16 +02:00
See #890: expose number of reports linked to tracks, albums, libraries, accounts and artists via the /stats route
This commit is contained in:
parent
d4deb830c0
commit
9552b49a46
12 changed files with 73 additions and 2 deletions
|
@ -73,7 +73,7 @@ class LocalFromFidQuerySet:
|
|||
return self.filter(~query)
|
||||
|
||||
|
||||
class MutationQuerySet(models.QuerySet):
|
||||
class GenericTargetQuerySet(models.QuerySet):
|
||||
def get_for_target(self, target):
|
||||
content_type = ContentType.objects.get_for_model(target)
|
||||
return self.filter(target_content_type=content_type, target_id=target.pk)
|
||||
|
@ -119,7 +119,7 @@ class Mutation(models.Model):
|
|||
)
|
||||
target = GenericForeignKey("target_content_type", "target_id")
|
||||
|
||||
objects = MutationQuerySet.as_manager()
|
||||
objects = GenericTargetQuerySet.as_manager()
|
||||
|
||||
def get_federation_id(self):
|
||||
if self.fid:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue