4647be958b
* adds UserActionLogEntry model to user/models.py * wraps user and timestamp info * can be extended for more information in the future * refactors all filtering and accessing on values
38 lines
902 B
Python
38 lines
902 B
Python
"""
|
|
Author: Michel Peltriaux
|
|
Organization: Struktur- und Genehmigungsdirektion Nord, Rhineland-Palatinate, Germany
|
|
Contact: michel.peltriaux@sgdnord.rlp.de
|
|
Created on: 29.07.21
|
|
|
|
"""
|
|
from django.db.models import QuerySet
|
|
|
|
from intervention.filters import InterventionTableFilter
|
|
|
|
|
|
class CompensationTableFilter(InterventionTableFilter):
|
|
""" TableFilter for compensations
|
|
|
|
Based widely on InterventionTableFilter.
|
|
Just some minor changes for Compensation model.
|
|
|
|
"""
|
|
|
|
def _filter_show_recorded(self, queryset, name, value) -> QuerySet:
|
|
""" Filters queryset depending on value of 'show_recorded' setting
|
|
|
|
Args:
|
|
queryset ():
|
|
name ():
|
|
value ():
|
|
|
|
Returns:
|
|
|
|
"""
|
|
if not value:
|
|
return queryset.filter(
|
|
intervention__recorded=None,
|
|
)
|
|
else:
|
|
return queryset
|