Saturday, July 23, 2016

Re: Django selected value

I signed value/name as variants. Problem is i can`t get any of these- value of selected item and name of selected item.
I was try:
Model2.objects.order_by('choice_field')
Model2.objects.values('choice_field')
Model2.objects.values_list('choice_field')
Model2.objects.all()

I can`t get - as value of selected item - such as name of selected  item
When i save model - selected item saved and I see selected item in drop box. How to get anything from this drop box  instead {'choice_field': 5}?
Now I try all queryset methods - on this time - nothing.

--
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/9e69153e-8913-4be4-8331-73529ca9e885%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment