Hi, I'm creating a model with a field as follows:

trackno = models.PositiveSmallIntegerField(choices=SONGNO_CHOICES)

I try to create the SONGNO_CHOICES tuple with this code:

dict = {}
j = 0
while j<100:
    dict[j]=(j,j+1)
    j=j+1

SONGNO_CHOICES = dict

When a try to validate my model, Django always return the same error:
canciones.song: "trackno": "choices" should be a sequence of two-
tuples.

How can I cast this 2 values dictionary into a 2 values tuple?

Thanks for your help.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to