3
0
Fork 0
mirror of https://github.com/nanoy42/coope synced 2024-11-25 22:22:27 +00:00

Changement des widgtes

This commit is contained in:
Yoann Pétri 2019-01-17 23:25:56 +01:00
parent be65967e3c
commit 53d4acae01

View file

@ -16,20 +16,21 @@ class ReloadForm(forms.ModelForm):
class Meta:
model = Reload
fields = ("customer", "amount", "PaymentMethod")
widgets = {'customer': autocomplete.ModelSelect2(url='users:active-users-autocomplete', attrs={'data-minimum-input-length':2})}
widgets = {'customer': autocomplete.ModelSelect2(url='users:active-users-autocomplete', attrs={'data-minimum-input-length':2}), 'amount': forms.TextInput}
class RefundForm(forms.ModelForm):
class Meta:
model = Refund
fields = ("customer", "amount")
widgets = {'customer': autocomplete.ModelSelect2(url='users:active-users-autocomplete', attrs={'data-minimum-input-length':2})}
widgets = {'customer': autocomplete.ModelSelect2(url='users:active-users-autocomplete', attrs={'data-minimum-input-length':2}), 'amount': forms.TextInput}
class ProductForm(forms.ModelForm):
class Meta:
model = Product
fields = "__all__"
widgets = {'amount': forms.TextInput}
class KegForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
@ -41,11 +42,13 @@ class KegForm(forms.ModelForm):
class Meta:
model = Keg
exclude = ("is_active", )
widgets = {'amount': forms.TextInput}
class MenuForm(forms.ModelForm):
class Meta:
model = Menu
fields = "__all__"
widgets = {'amount': forms.TextInput}
class SearchProductForm(forms.Form):
product = forms.ModelChoiceField(queryset=Product.objects.all(), required=True, label="Produit", widget=autocomplete.ModelSelect2(url='gestion:products-autocomplete', attrs={'data-minimum-input-length':2}))