style(parsers): format date result filters
This commit is contained in:
@@ -2328,9 +2328,7 @@ def _apply_record_date_range(queryset, record_date_field: str, params: dict):
|
|||||||
)
|
)
|
||||||
date_to = params.get("date_to")
|
date_to = params.get("date_to")
|
||||||
if date_to:
|
if date_to:
|
||||||
queryset = queryset.filter(
|
queryset = queryset.filter(**{f"{record_date_field}__lte": date_to.isoformat()})
|
||||||
**{f"{record_date_field}__lte": date_to.isoformat()}
|
|
||||||
)
|
|
||||||
return queryset
|
return queryset
|
||||||
|
|
||||||
|
|
||||||
@@ -2379,9 +2377,7 @@ def _filter_native_result_queryset(source: str, params: dict, sources: set[str])
|
|||||||
if params.get("record_date") and field_map.get("record_date"):
|
if params.get("record_date") and field_map.get("record_date"):
|
||||||
queryset = queryset.filter(**{field_map["record_date"]: params["record_date"]})
|
queryset = queryset.filter(**{field_map["record_date"]: params["record_date"]})
|
||||||
if field_map.get("record_date"):
|
if field_map.get("record_date"):
|
||||||
queryset = _apply_record_date_range(
|
queryset = _apply_record_date_range(queryset, field_map["record_date"], params)
|
||||||
queryset, field_map["record_date"], params
|
|
||||||
)
|
|
||||||
if params.get("search"):
|
if params.get("search"):
|
||||||
queryset = _apply_native_search(queryset, source, params["search"])
|
queryset = _apply_native_search(queryset, source, params["search"])
|
||||||
ordering = _safe_ordering(
|
ordering = _safe_ordering(
|
||||||
|
|||||||
Reference in New Issue
Block a user