filter_tools
django_spire.contrib.queryset.filter_tools
filter_by_lookup_map
Filters a given queryset based on a lookup map and provided data. Additional filters can also be applied if provided.
Parameters:
-
(QuerySet)(queryset) –The queryset to be filtered.
-
(dict)(lookup_map) –A dictionary mapping input data keys to filtering fields in the queryset.
-
None)–Optional. A list of extra positional filter arguments to be applied. Defaults to None.
Returns:
-
–
QuerySet: The filtered queryset.
Source code in django_spire/contrib/queryset/filter_tools.py
filter_by_model_fields
Filters a given queryset based on the queryset's model fields and provided data.
Parameters:
-
(QuerySet)(queryset) –The queryset to be filtered.
-
(dict)(data) –A dictionary containing key-value pairs to filter the queryset.
Returns:
-
QuerySet–QuerySet: The filtered queryset.