mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 03:59:24 +02:00
Added API to list and detail actors
This commit is contained in:
parent
bbc36201c8
commit
47209ee5ae
7 changed files with 174 additions and 2 deletions
|
@ -61,6 +61,21 @@ class ActorQuerySet(models.QuerySet):
|
|||
|
||||
return qs
|
||||
|
||||
def with_outbox_activities_count(self):
|
||||
return self.annotate(
|
||||
outbox_activities_count=models.Count("outbox_activities", distinct=True)
|
||||
)
|
||||
|
||||
def with_followers_count(self):
|
||||
return self.annotate(
|
||||
followers_count=models.Count("received_follows", distinct=True)
|
||||
)
|
||||
|
||||
def with_uploads_count(self):
|
||||
return self.annotate(
|
||||
uploads_count=models.Count("libraries__uploads", distinct=True)
|
||||
)
|
||||
|
||||
|
||||
class DomainQuerySet(models.QuerySet):
|
||||
def external(self):
|
||||
|
@ -71,7 +86,7 @@ class DomainQuerySet(models.QuerySet):
|
|||
|
||||
def with_outbox_activities_count(self):
|
||||
return self.annotate(
|
||||
outbox_activities_count=models.Count("actors__outbox_activities")
|
||||
outbox_activities_count=models.Count("actors__outbox_activities", distinct=True)
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue