mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 08:31:08 -05:00
Refactor code structure and remove redundant changes
This commit is contained in:
@@ -530,7 +530,7 @@ class MasterFilterForm(BaseFilterForm):
|
||||
|
||||
return cleaned_data
|
||||
|
||||
def get_search_filters(self) -> Dict[str, Any]:
|
||||
def get_filter_dict(self) -> Dict[str, Any]:
|
||||
"""Convert form data to search service filter format."""
|
||||
if not self.is_valid():
|
||||
return {}
|
||||
@@ -544,13 +544,32 @@ class MasterFilterForm(BaseFilterForm):
|
||||
|
||||
return filters
|
||||
|
||||
def get_active_filters_summary(self) -> Dict[str, Any]:
|
||||
def get_search_filters(self) -> Dict[str, Any]:
|
||||
"""Alias for get_filter_dict for backward compatibility."""
|
||||
return self.get_filter_dict()
|
||||
|
||||
def get_filter_summary(self) -> Dict[str, Any]:
|
||||
"""Get summary of active filters for display."""
|
||||
active_filters = {}
|
||||
|
||||
if not self.is_valid():
|
||||
return active_filters
|
||||
|
||||
def get_active_filters_summary(self) -> Dict[str, Any]:
|
||||
"""Alias for get_filter_summary for backward compatibility."""
|
||||
return self.get_filter_summary()
|
||||
|
||||
def has_active_filters(self) -> bool:
|
||||
"""Check if any filters are currently active."""
|
||||
if not self.is_valid():
|
||||
return False
|
||||
|
||||
for field_name, value in self.cleaned_data.items():
|
||||
if value: # If any field has a value, we have active filters
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
# Group filters by category
|
||||
categories = {
|
||||
"Search": ["global_search", "name_search", "description_search"],
|
||||
|
||||
Reference in New Issue
Block a user