Thursday, June 22, 2017

model choice field

hello

i have a model choice field like this:

LEVEL_CHOICES = [
        ('1', 'one'),
        ('2', 'two'),
        ('3', 'three'),
    ]

but when i select from database and say:

{{object.level}}

 it shows me 1 or 2 or 3 but i wanted to be one or two or three

how can i do that?

i did some search but i got nothing , actually i dont now what i have to search for this problem

thank you

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/52c1fb1b-9e70-42dd-9d7f-4f608f190d97%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment