class HorizontalFiltersWidget(FilteredSelectMultiple):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.filter_cache = {x.pk: x for x in Filter.objects.all()}
def render_option(self, selected_choices, option_value, option_label):
# Very dirty hack but i've not found better solution
option_label = self.filter_cache[option_value].get_path()
return super().render_option(selected_choices, option_value, option_label)