Add event meta data fields to order search form

This commit is contained in:
Raphael Michel
2020-06-04 18:39:30 +02:00
parent cd5f6b66a1
commit effc9723f1
3 changed files with 81 additions and 21 deletions

View File

@@ -22,6 +22,9 @@ class OrderSearch(PaginationMixin, ListView):
def get_context_data(self, **kwargs):
ctx = super().get_context_data()
ctx['filter_form'] = self.filter_form
ctx['meta_fields'] = [
self.filter_form[k] for k in self.filter_form.fields if k.startswith('meta_')
]
# Only compute this annotations for this page (query optimization)
s = OrderPosition.objects.filter(