Skip to content

Instantly share code, notes, and snippets.

@leopard627
Last active August 13, 2020 03:07
Show Gist options
  • Save leopard627/43c33d03172c1a6dc7268ddc918cc1ba to your computer and use it in GitHub Desktop.
Save leopard627/43c33d03172c1a6dc7268ddc918cc1ba to your computer and use it in GitHub Desktop.
class Movie(models.Model):
title = models.CharField()
rate = models.FloatField()
......
....
...
.......
q1 = Movie.objects.filter(rate=1.0).count()
q2 = Movie.objects.filter(rate=2.0).count()
q3 = Movie.objects.filter(rate=3.0).count()
q4 = Movie.objects.filter(rate=4.0).count()
q5 = Movie.objects.filter(rate=5.0).count()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment