Z
Z
zigen2015-06-30 17:24:20
Django
zigen, 2015-06-30 17:24:20

Why is the property not defined via widget?

Good afternoon.
Why is the attribute not added to the select field in this implementation:

class VendorRegForm(forms.ModelForm):
    class Meta:
        model = VendorProfile
        fields = ('org_name','slug', 'kind_activity')
        ....
       kind_activity = forms.ModelChoiceField(queryset = Activity.objects.all(),
                                                               widget=forms.Select(attrs={'class': 'form-control'}))

form-control class not being added to template

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem Klimenko, 2015-06-30
@zigen

for modal forms, the widget is redefined differently:
djbook.ru/rel1.8/topics/forms/modelforms.html#over...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question