club: ClubSellingView way faster and with multiple selections everywhere

This commit is contained in:
klmp200 committed 2019-11-27 20:59:32 +01:00
1 parent af48553e35
commit 7d40e11144
2 files changed
+25 -17

No files matched your search

+5 -5
View File
@@ -170,21 +170,21 @@ class SellingsForm(forms.Form):
required=False,
widget=SelectDateTime,
)
counter = forms.ModelChoiceField(
counters = forms.ModelMultipleChoiceField(
Counter.objects.order_by("name").all(), label=_("Counter"), required=False
)
def __init__(self, club, *args, **kwargs):
super(SellingsForm, self).__init__(*args, **kwargs)
self.fields["product"] = forms.ModelChoiceField(
self.fields["products"] = forms.ModelMultipleChoiceField(
club.products.order_by("name").filter(archived=False).all(),
label=_("Product"),
label=_("Products"),
required=False,
)
self.fields["archived_product"] = forms.ModelChoiceField(
self.fields["archived_products"] = forms.ModelMultipleChoiceField(
club.products.order_by("name").filter(archived=True).all(),
label=_("Archived product"),
label=_("Archived products"),
required=False,
)