Item update: restrict choices

This commit is contained in:
Raphael Michel
2014-09-29 11:14:19 +02:00
parent 9749181101
commit d831980f1e
3 changed files with 23 additions and 4 deletions

View File

@@ -42,6 +42,11 @@ class PropertyList(ListView):
class ItemUpdateFormGeneral(forms.ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['category'].queryset = self.instance.event.categories.all()
self.fields['properties'].queryset = self.instance.event.properties.all()
class Meta:
model = Item
localized_fields = '__all__'