forked from CGM_Public/pretix_original
Include category in ItemCreateForm
This commit is contained in:
@@ -110,6 +110,7 @@ class ItemCreateForm(I18nModelForm):
|
|||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.event = kwargs['event']
|
self.event = kwargs['event']
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
self.fields['category'].queryset = self.instance.event.categories.all()
|
||||||
self.fields['copy_from'] = forms.ModelChoiceField(
|
self.fields['copy_from'] = forms.ModelChoiceField(
|
||||||
label=_("Copy product information"),
|
label=_("Copy product information"),
|
||||||
queryset=self.event.items.all(),
|
queryset=self.event.items.all(),
|
||||||
@@ -140,6 +141,7 @@ class ItemCreateForm(I18nModelForm):
|
|||||||
localized_fields = '__all__'
|
localized_fields = '__all__'
|
||||||
fields = [
|
fields = [
|
||||||
'name',
|
'name',
|
||||||
|
'category',
|
||||||
'admission',
|
'admission',
|
||||||
'default_price',
|
'default_price',
|
||||||
'tax_rate',
|
'tax_rate',
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
{% bootstrap_field form.name layout="horizontal" %}
|
{% bootstrap_field form.name layout="horizontal" %}
|
||||||
{% bootstrap_field form.copy_from layout="horizontal" %}
|
{% bootstrap_field form.copy_from layout="horizontal" %}
|
||||||
{% bootstrap_field form.has_variations layout="horizontal" %}
|
{% bootstrap_field form.has_variations layout="horizontal" %}
|
||||||
|
{% bootstrap_field form.category layout="horizontal" %}
|
||||||
{% bootstrap_field form.admission layout="horizontal" %}
|
{% bootstrap_field form.admission layout="horizontal" %}
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
|
|||||||
Reference in New Issue
Block a user