im trying to pass a generated “choices” to my model field, please where is the problem?
#models.py
...
def quantity_total():
for x in range(0,100): return "(" + str(x) + "," + str(x) + "),"
QUANTITY = (quantity_total())
class Package(models.Model):
...
...
quantity = models.SmallIntegerField(choices=QUANTITY, max_length=3)
Thanks guys
choicesis supposed to be an iterable of 2-tuples, not a string.