Fix prefetch

This commit is contained in:
2026-06-09 11:37:41 +02:00
parent 6f4841eaaa
commit ed086c9702
7 changed files with 64 additions and 41 deletions
+2 -4
View File
@@ -7,7 +7,7 @@ from django.utils.safestring import SafeText, mark_safe
from common.components.core import Component
from common.components.primitives import Label, Span
from common.components.search_select import FilterSelect, LabeledOption
from common.components.search_select import DEFAULT_PREFETCH, FilterSelect, LabeledOption
class FilterChoice(NamedTuple):
@@ -91,8 +91,6 @@ def _parse_bool(existing: dict, key: str) -> bool:
# option set; model-backed fields fetch from a search endpoint on demand, with
# labels embedded in the filter JSON so pills render without a DB round-trip.
_FILTER_PREFETCH = 20
# Presence modifiers drive the pinned (Any)/(None) pseudo-options. They are
# mutually exclusive with value pills (selecting one clears the value set).
# Must match JS PRESENCE_MODIFIERS in search_select.js.
@@ -189,7 +187,7 @@ def _model_filter(
modifier=modifier,
modifier_options=_modifier_options(nullable, m2m_modifiers),
search_url=search_url,
prefetch=_FILTER_PREFETCH,
prefetch=DEFAULT_PREFETCH,
)