From eab801e41b3bba8e81be2922e69e1e9048b92e71 Mon Sep 17 00:00:00 2001 From: AlexSserb Date: Wed, 5 Nov 2025 20:52:50 +0400 Subject: [PATCH] feat: lexoranks for attr options --- models/attr_select.py | 1 + schemas/attr_option.py | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/models/attr_select.py b/models/attr_select.py index 003d03e..c79698a 100644 --- a/models/attr_select.py +++ b/models/attr_select.py @@ -34,6 +34,7 @@ class AttributeOption(BaseModel, IdMixin, SoftDeleteMixin): __tablename__ = "attribute_options" name: Mapped[str] = mapped_column() + lexorank: Mapped[str] = mapped_column(comment="Ранг опции") select_id: Mapped[int] = mapped_column(ForeignKey("attribute_selects.id")) select: Mapped[AttributeSelect] = relationship( diff --git a/schemas/attr_option.py b/schemas/attr_option.py index 0971b25..46802da 100644 --- a/schemas/attr_option.py +++ b/schemas/attr_option.py @@ -1,3 +1,5 @@ +from typing import Optional + from schemas.base import BaseSchema, BaseResponse @@ -7,15 +9,18 @@ from schemas.base import BaseSchema, BaseResponse class AttrOptionSchema(BaseSchema): id: int name: str + lexorank: str class CreateAttrOptionSchema(BaseSchema): name: str + lexorank: str select_id: int class UpdateAttrOptionSchema(BaseSchema): - name: str + name: Optional[str] = None + lexorank: Optional[str] = None # endregion