summaryrefslogtreecommitdiff
path: root/procurement/forms.py
diff options
context:
space:
mode:
authorworkmai <iain.workman@lightsource.ca>2018-10-04 12:14:39 -0600
committerworkmai <iain.workman@lightsource.ca>2018-10-04 12:14:39 -0600
commit12d1f9fd979c11b9e3a3a89b1595b07569b88f79 (patch)
treeaf591040768b104f4bb840a21a92968848a0ffe6 /procurement/forms.py
downloadcoding-assignment-12d1f9fd979c11b9e3a3a89b1595b07569b88f79.zip
coding-assignment-12d1f9fd979c11b9e3a3a89b1595b07569b88f79.tar.gz
coding-assignment-12d1f9fd979c11b9e3a3a89b1595b07569b88f79.tar.bz2
Initial commit of the coding assignment base project
Diffstat (limited to 'procurement/forms.py')
-rw-r--r--procurement/forms.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/procurement/forms.py b/procurement/forms.py
new file mode 100644
index 0000000..4e8b0aa
--- /dev/null
+++ b/procurement/forms.py
@@ -0,0 +1,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"})
+