Filtering Posts greater than certain number of likes

Viewed 83

I have a question about filtering Posts by Like count greater than a given number.

What I want to achieve is on DJANGO SHELL when I type post.likes is greater than 10 I want to see all posts with more than 10 likes.

How can I do that?

Thanks

models.py

class Post(models.Model,HitCountMixin):
  likes = models.ManyToManyField(User, related_name="likes", blank=True)
1 Answers
Related