feat: lexoranks for attr options
This commit is contained in:
@ -34,6 +34,7 @@ class AttributeOption(BaseModel, IdMixin, SoftDeleteMixin):
|
|||||||
__tablename__ = "attribute_options"
|
__tablename__ = "attribute_options"
|
||||||
|
|
||||||
name: Mapped[str] = mapped_column()
|
name: Mapped[str] = mapped_column()
|
||||||
|
lexorank: Mapped[str] = mapped_column(comment="Ранг опции")
|
||||||
|
|
||||||
select_id: Mapped[int] = mapped_column(ForeignKey("attribute_selects.id"))
|
select_id: Mapped[int] = mapped_column(ForeignKey("attribute_selects.id"))
|
||||||
select: Mapped[AttributeSelect] = relationship(
|
select: Mapped[AttributeSelect] = relationship(
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
from typing import Optional
|
||||||
|
|
||||||
from schemas.base import BaseSchema, BaseResponse
|
from schemas.base import BaseSchema, BaseResponse
|
||||||
|
|
||||||
|
|
||||||
@ -7,15 +9,18 @@ from schemas.base import BaseSchema, BaseResponse
|
|||||||
class AttrOptionSchema(BaseSchema):
|
class AttrOptionSchema(BaseSchema):
|
||||||
id: int
|
id: int
|
||||||
name: str
|
name: str
|
||||||
|
lexorank: str
|
||||||
|
|
||||||
|
|
||||||
class CreateAttrOptionSchema(BaseSchema):
|
class CreateAttrOptionSchema(BaseSchema):
|
||||||
name: str
|
name: str
|
||||||
|
lexorank: str
|
||||||
select_id: int
|
select_id: int
|
||||||
|
|
||||||
|
|
||||||
class UpdateAttrOptionSchema(BaseSchema):
|
class UpdateAttrOptionSchema(BaseSchema):
|
||||||
name: str
|
name: Optional[str] = None
|
||||||
|
lexorank: Optional[str] = None
|
||||||
|
|
||||||
|
|
||||||
# endregion
|
# endregion
|
||||||
|
|||||||
Reference in New Issue
Block a user