Skip to content

Instantly share code, notes, and snippets.

@leopard627
Created August 13, 2020 03:03
Show Gist options
  • Save leopard627/bf1d91a8df10e92de255b4a0c36169f6 to your computer and use it in GitHub Desktop.
Save leopard627/bf1d91a8df10e92de255b4a0c36169f6 to your computer and use it in GitHub Desktop.
class Movie(models.Model):
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