# 61 EcoAccount Filter
* adds specialized SelectionTableFilter for EcoAccount (and EMA) which only provides filtering by conservation office
This commit is contained in:
parent
07b079d1b6
commit
b96dcd373a
@ -10,6 +10,7 @@ from django.utils.translation import gettext_lazy as _
|
||||
from django import forms
|
||||
from django.db.models import QuerySet, Q
|
||||
|
||||
from konova.filters.mixins import ConservationOfficeTableFilterMixin
|
||||
from konova.filters.table_filters import QueryTableFilter, CheckboxTableFilter, SelectionTableFilter, AbstractTableFilter
|
||||
|
||||
|
||||
@ -163,6 +164,15 @@ class CheckboxEcoAccountTableFilter(CheckboxTableFilter):
|
||||
return queryset
|
||||
|
||||
|
||||
class SelectionEcoAccountTableFilter(ConservationOfficeTableFilterMixin):
|
||||
""" Special selection table filter for eco accounts
|
||||
|
||||
EcoAccounts only need a selection filter for conservation office
|
||||
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class EcoAccountTableFilter(AbstractTableFilter):
|
||||
""" TableFilter for eco accounts
|
||||
|
||||
@ -174,7 +184,7 @@ class EcoAccountTableFilter(AbstractTableFilter):
|
||||
request_data = kwargs.get("data", None)
|
||||
|
||||
# Pipe the queryset through all needed filters
|
||||
self.selection_filter = SelectionTableFilter(
|
||||
self.selection_filter = SelectionEcoAccountTableFilter(
|
||||
data=request_data,
|
||||
queryset=qs,
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user