Answer the question
In order to leave comments, you need to log in
How to fix output in Django?
how to make the status output not a number but a string
src=" https://habrastorage.org/webt/5f/20/1a/5f201ae92dd... " alt="image"/>
models.py
class Order(models.Model):
COOCKING = 1
READY = 2
ONTHEWAY = 3
DELIVERED = 4
STATUS_CHOICES = (
(COOCKING,"COOCKING"),
(READY, "READY"),
(ONTHEWAY, "ON THE WAY"),
(DELIVERED, "DELIVERED"),
)
status = models.IntegerField( choices = STATUS_CHOICES)
<td>{{ order.status}}</td>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question