A
A
Alexander2015-04-03 08:45:27
Django
Alexander, 2015-04-03 08:45:27

How to pass select value to template?

Good afternoon, there is such a form of a drop-down list http://pastebin.ru/CvRz3MPW , so how to transfer the selected element to the template? For example, a person selected millimeters, you need to transfer 'millimeters' to the template and not the value 1.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri Shikanov, 2015-04-03
@dizballanze

just set the values ​​for the form field to weight_first = 1 and when the field widget is displayed, django will select the desired list item

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question