Задать вопрос

Тел: +7 965 3737 888

464

Просмотров

1

Ответов

DropDownMultiple widget

<p>Observation: depends on jQuery to works!</p>
<p>This widget works like other multiple select widgets, but it shows a drop down field for each choice user does, and aways let a blank choice at the end where the user can choose a new, etc.</p>
<p>Example using it:</p>
class MyForm(forms.ModelForm):
    categories = forms.Field(widget=DropDownMultiple)

    def __init__(self, *args, **kwargs):
        self.base_fields['categories'].widget.choices = Category.objects.values_list('id', 'name')
        super(MyForm, self).__init__(*args, **kwargs)

Вопрос полезен? Да0/Нет0
file_4469.py(2.5Кб)
None

Ответы (1):

Ответmarinho:13.05.2008
Ответ полезен? Да0/Нет0

Fixed problem when selecting in an already filled select object.