It's a question by curiosity :
So i have 4 types of choice for field of a model.
class Thing(models.Model):
Cat_One = (("b", "Big"), ("s", "Small"),("a","very small"),("x","xtra small"))
dateCreation = models.DateTimeField(null=True, blank=True)
url = models.CharField(null=True, blank=True, max_length=800)
name = models.CharField(blank=True, null=True, max_length=200)
catOne = models.CharField(max_length=1, choices=Cat_One, blank=True, null=True)
so i can pass the choice to the django template :
{% for choice in cat_One %}
... And iterate.
But i would like to know , how to iterate from 1 to 4 without passing something to the django template ?
Is there a way to do :
{% for number in [1,2,3,4] %}
or something with a forloop counter ?
regards