18👍
As you said max possible score is 100
so it will always return all objects because lte
means return all objects whose score is either less than or equal to 100
. You might need lt
lookup which means just return those objects whose score is less than 100
:
filtered = all_objects.filter(score__lt=100)
10👍
You are saying that The max possible score is 100
. By using score__lte=100
, you are filtering all objects with score
less than or equal to 100 – which is every object in the table by your own definition.
- How to display "x days ago" type time using Humanize in Django template?
- AWS Elastic Beanstalk Container Commands Failing
Source:stackexchange.com