3
0
Fork 0
mirror of https://github.com/nanoy42/coope synced 2024-11-05 01:16:28 +00:00

Merge branch 'type_biere' into dev

Close #16.
This commit is contained in:
Yoann Pétri 2018-12-17 08:44:13 +01:00
commit 4b0fb1cda9

View file

@ -32,6 +32,12 @@ class ProductForm(forms.ModelForm):
fields = "__all__"
class KegForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(KegForm, self).__init__(*args, **kwargs)
self.fields['pinte'].queryset = Product.objects.filter(category=Product.P_PRESSION)
self.fields['demi'].queryset = Product.objects.filter(category=Product.D_PRESSION)
self.fields['galopin'].queryset = Product.objects.filter(category=Product.G_PRESSION)
class Meta:
model = Keg
exclude = ("is_active", )