Good day! In forms.py of ChoiceField(choices=((1, Значение1),(2, Значение2),....)) in html -> <select......><option value=1>Значение1<..... I need to add an attribute and pass a unique value into it. Is it possible to do this? The documentation describes examples for adding static attributes.

    1 answer 1

    https://docs.djangoproject.com/en/2.0/_modules/django/forms/widgets/#Select Here is your widget, see how it works, how it is built in the template. Maybe you will create a new widget. If you follow this, it may override the template by passing dynamic attributes along with the choices. There are options and if you solve this problem, you will get good knowledge :)