fix: applied timezone to default values, removed value nesting
This commit is contained in:
@ -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",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user