summaryrefslogtreecommitdiff
path: root/procurement/forms.py
blob: 4e8b0aa11672d165812ab2599ec791ce907b58a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from django import forms
from procurement.models import Component


class ComponentSearchForm(forms.Form):
    component = forms.ModelChoiceField(
        queryset=Component.objects.all(),
        required=False
    )

    def __init__(self, *args, **kwargs):
        super(ComponentSearchForm, self).__init__(*args, **kwargs)
        self.fields['component'].widget.attrs.update({"class": "form-control"})