feat: Add orm for Tools and clean up Tool logic (#1935)
This commit is contained in:
@@ -55,7 +55,6 @@ class OrganizationMixin(Base):
|
||||
|
||||
__abstract__ = True
|
||||
|
||||
# Changed _organization_id to store string (still a valid UUID4 string)
|
||||
_organization_id: Mapped[str] = mapped_column(String, ForeignKey("organization._id"))
|
||||
|
||||
@property
|
||||
@@ -65,3 +64,19 @@ class OrganizationMixin(Base):
|
||||
@organization_id.setter
|
||||
def organization_id(self, value: str) -> None:
|
||||
_relation_setter(self, "organization", value)
|
||||
|
||||
|
||||
class UserMixin(Base):
|
||||
"""Mixin for models that belong to a user."""
|
||||
|
||||
__abstract__ = True
|
||||
|
||||
_user_id: Mapped[str] = mapped_column(String, ForeignKey("user._id"))
|
||||
|
||||
@property
|
||||
def user_id(self) -> str:
|
||||
return _relation_getter(self, "user")
|
||||
|
||||
@user_id.setter
|
||||
def user_id(self, value: str) -> None:
|
||||
_relation_setter(self, "user", value)
|
||||
|
||||
Reference in New Issue
Block a user