Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 31, 2023
1 parent 418fa01 commit 7b34cb2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion taggit/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,8 @@ def clear(self):
def most_common(self, min_count=None, extra_filters=None):
kwargs = extra_filters if extra_filters else {}
queryset = (
self.through.tag_model().objects.filter(**kwargs)
self.through.tag_model()
.objects.filter(**kwargs)
.annotate(num_times=models.Count(self.through.tag_relname()))
.order_by("-num_times")
)
Expand Down

0 comments on commit 7b34cb2

Please sign in to comment.