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.
16 lines
299 B
Python
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
|