mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
Fix #782 -- Select2 widget for item selection for vouchers
This commit is contained in:
@@ -36,3 +36,23 @@ class Select2(Select2Mixin, forms.Select):
|
||||
|
||||
class Select2Multiple(Select2Mixin, forms.SelectMultiple):
|
||||
pass
|
||||
|
||||
|
||||
class Select2ItemVarQuotaMixin(Select2Mixin):
|
||||
|
||||
def options(self, name, value, attrs=None):
|
||||
if value and value[0]:
|
||||
yield self.create_option(
|
||||
None,
|
||||
value[0],
|
||||
value[0],
|
||||
True,
|
||||
0,
|
||||
subindex=None,
|
||||
attrs=attrs
|
||||
)
|
||||
return
|
||||
|
||||
|
||||
class Select2ItemVarQuota(Select2ItemVarQuotaMixin, forms.Select):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user