mpeltriaux
4c5e170b85
* enhances rendering of tables * enhances rendering of filter section * reorganizes table filter codes into konova/filters/ folder and splits into mixins and table_filters
34 lines
1.1 KiB
Python
34 lines
1.1 KiB
Python
"""
|
|
Author: Michel Peltriaux
|
|
Organization: Struktur- und Genehmigungsdirektion Nord, Rhineland-Palatinate, Germany
|
|
Contact: michel.peltriaux@sgdnord.rlp.de
|
|
Created on: 22.07.21
|
|
|
|
"""
|
|
from konova.filters.table_filters import AbstractTableFilter, SelectionTableFilter, QueryTableFilter, CheckboxTableFilter
|
|
|
|
|
|
class InterventionTableFilter(AbstractTableFilter):
|
|
def __init__(self, user=None, *args, **kwargs):
|
|
super().__init__(*args, **kwargs)
|
|
self.user = user
|
|
qs = kwargs.get("queryset", None)
|
|
request_data = kwargs.get("data", None)
|
|
|
|
# Pipe the queryset through all needed filters
|
|
self.selection_filter = SelectionTableFilter(
|
|
data=request_data,
|
|
queryset=qs,
|
|
)
|
|
self.query_filter = QueryTableFilter(
|
|
data=request_data,
|
|
queryset=self.selection_filter.qs,
|
|
)
|
|
self.checkbox_filter = CheckboxTableFilter(
|
|
user=user,
|
|
data=request_data,
|
|
queryset=self.query_filter.qs,
|
|
)
|
|
self.qs = self.checkbox_filter.qs
|
|
|