I have a Model which has some constants defined, like below:
class Order(models.Model):
WAITING = 0
APPROVED = 1
DISAPPROVED =2
I want to display some conditional tags in my template, for example, showing an hourglass icon if the displayed Order has the status of WAITING.
Currently I'm doing it like below, but I don't like it because that way, I need to keep track of values of every constants:
{% if order.status == 0 %}
your order is waiting approval.
{% endif
How can I access Order.WAITING, Order.APPROVED and Order.DISAPPROVED constants from my templates? What is the correct way of what I want to achieve?