This hook wraps a standard Misago function used to retrieve a set of arguments for the values call on the categories queryset.
This hook can be imported from misago.categories.hooks:
from misago.categories.hooks import get_categories_query_values_hookdef custom_get_categories_query_values_filter(action: GetCategoriesQueryValuesHookAction) -> set[str]:
...A function implemented by a plugin that can be registered in this hook.
A Python set with names of the Category model fields to include in the queryset.
def get_categories_query_values_action(self) -> set[str]:
...Misago function used to retrieve a set of arguments for the values call on the categories queryset.
A Python set with names of the Category model fields to include in the queryset.
The code below implements a custom filter function that includes the plugin_data field in the queryset.
from misago.categories.hooks import get_categories_query_values_hook
@get_categories_query_values_hook.append_filter
def include_plugin_data_in_query(action) -> set[str]:
fields = action(groups)
fields.add("plugin_data")
return fields