feat: attr options and selects editing

This commit is contained in:
2025-11-04 12:18:53 +04:00
parent a7bda3d9f6
commit c266814c96
11 changed files with 239 additions and 40 deletions

View File

@ -13,7 +13,7 @@ if TYPE_CHECKING:
class AttributeSelect(BaseModel, IdMixin, SoftDeleteMixin):
__tablename__ = "attribute_selects"
label: Mapped[str] = mapped_column()
name: Mapped[str] = mapped_column()
is_built_in: Mapped[bool] = mapped_column(
default=False,
comment="Если встроенный select, то запрещено редактировать пользователю",
@ -33,7 +33,7 @@ class AttributeSelect(BaseModel, IdMixin, SoftDeleteMixin):
class AttributeOption(BaseModel, IdMixin, SoftDeleteMixin):
__tablename__ = "attribute_options"
label: Mapped[str] = mapped_column()
name: Mapped[str] = mapped_column()
select_id: Mapped[int] = mapped_column(ForeignKey("attribute_selects.id"))
select: Mapped[AttributeSelect] = relationship(