Initial Commit

This commit is contained in:
2023-09-08 19:05:37 +03:00
commit 7e60195cb7
185 changed files with 27107 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
from sqlalchemy import Column, String, Integer
from sqlalchemy.orm import relationship
from models.common.base import BaseModel
class environment(BaseModel):
"""
description: Technological infrastructure environments.
"""
__tablename__ = "tcc_environments"
_s_collection_name = "environments"
_s_class_name = "environment"
id = Column(Integer, primary_key=True, autoincrement=True, index=True)
name = Column(String(32), unique=True, index=True, nullable=False)
color = Column(String(7), index=False, nullable=True)
cluster = relationship("cluster", back_populates="environment")
pelement = relationship("pelement", back_populates="environment")
def to_dict(self):
result = BaseModel.to_dict(self)
result['name'] = result['name'].upper()
return result