schon/core/typing/models.py
Egor fureunoir Gorbunov 2114c8bb76 Features: 1) Add bulk_prefetch_filterable_attributes for optimized attribute fetching; 2) Introduce FilterableAttribute typing for standardizing attribute data across serializers and models; 3) Enhance CategoryDetailSerializer with custom list_serializer_class for bulk operations.
Fixes: 1) Replace redundant `get_filterable_attributes` logic with `filterable_attributes` property to avoid duplications; 2) Remove unnecessary imports and redundant comments in various modules.

Extra: Refactor admin queryset methods for optimization; remove unused `categories` field in `Attribute` model; improve clarity and maintainability of Graphene resolvers and related logic.
2025-10-26 16:21:34 +03:00

16 lines
299 B
Python

from typing import Literal, TypedDict
AttributeValueTypeLiteral = Literal[
"string",
"integer",
"float",
"boolean",
"array",
"object",
]
class FilterableAttribute(TypedDict):
attribute_name: str
possible_values: list[str]
value_type: AttributeValueTypeLiteral