fix: applied timezone to default values, removed value nesting

This commit is contained in:
2025-10-28 11:43:42 +04:00
parent c1196497d4
commit 9b109a7270
7 changed files with 80 additions and 62 deletions

View File

@ -98,19 +98,9 @@ class AttributeValue(BaseModel):
)
attribute: Mapped[Attribute] = relationship(
back_populates="values",
lazy="joined",
lazy="noload",
)
def set_value(self, value: Optional[dict | str | bool | int | float]):
if value is None:
return
self.value = {"value": value}
def get_value(self) -> Optional[dict | str | bool | int | float]:
if self.value is None:
return None
return self.value["value"]
class AttributeLabel(BaseModel):
__tablename__ = "attribute_labels"
@ -132,5 +122,5 @@ class AttributeLabel(BaseModel):
)
attribute: Mapped[Attribute] = relationship(
backref="attribute_labels",
lazy="joined",
lazy="noload",
)