Skip to content
Advertisement

How to use If else in queryset in django

I need to use if else condition for Value1 in my queryset..I have found average for my records in the queryset..I need to apply condition like..If my Value1 is between 90 and 110 then I have to get message as “great” and if its below 90 it must print as “low” and if above 140 it must print as “high”

I need to be print this output on my html file

Models.py:

JavaScript

urls.py:

JavaScript

Advertisement

Answer

JavaScript

next access it in template with {{ message }}

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement