diff options
author | workmai <iain.workman@lightsource.ca> | 2018-10-04 12:14:39 -0600 |
---|---|---|
committer | workmai <iain.workman@lightsource.ca> | 2018-10-04 12:14:39 -0600 |
commit | 12d1f9fd979c11b9e3a3a89b1595b07569b88f79 (patch) | |
tree | af591040768b104f4bb840a21a92968848a0ffe6 /procurement/admin_forms.py | |
download | coding-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/admin_forms.py')
-rw-r--r-- | procurement/admin_forms.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/procurement/admin_forms.py b/procurement/admin_forms.py new file mode 100644 index 0000000..b7bbd1c --- /dev/null +++ b/procurement/admin_forms.py @@ -0,0 +1,20 @@ +from django import forms +from django.contrib.admin.widgets import FilteredSelectMultiple + +from procurement.models import Supplier, Component + + +class ComponentAdminForm(forms.ModelForm): + suppliers = forms.ModelMultipleChoiceField( + queryset=Supplier.objects.filter(is_authorized=True), + required=False, + widget=FilteredSelectMultiple( + verbose_name='Suppliers', + is_stacked=False + ) + + ) + + class Meta: + model = Component + fields = ['name', 'sku', 'suppliers']
\ No newline at end of file |