Nuevos cambios en el servidor
This commit is contained in:
@@ -54,15 +54,12 @@ class Tenant(Base):
|
||||
String(20),
|
||||
default=TenantStatus.ACTIVE
|
||||
)
|
||||
is_active: Mapped[bool] = mapped_column(Boolean, default=True)
|
||||
|
||||
# Relaciones
|
||||
users: Mapped[List["User"]] = relationship("User", back_populates="tenant")
|
||||
tickets: Mapped[List["Ticket"]] = relationship("Ticket", back_populates="tenant")
|
||||
categories: Mapped[List["Category"]] = relationship("Category", back_populates="tenant")
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return f"<Tenant(id={self.id}, name='{self.name}', slug='{self.slug}')>"
|
||||
|
||||
@property
|
||||
def is_active(self) -> bool:
|
||||
"""Check if tenant is active."""
|
||||
return self.status == TenantStatus.ACTIVE
|
||||
return f"<Tenant(id={self.id}, name='{self.name}', slug='{self.slug}')>"
|
||||
Reference in New Issue
Block a user