added dd-254 model
This commit is contained in:
@@ -20,3 +20,4 @@ from .request_internal_comment import RequestInternalComment
|
||||
from .audit_event import AuditEvent
|
||||
from .invitation import Invitation
|
||||
from .task_order import TaskOrder
|
||||
from .dd_254 import DD254
|
||||
|
31
atst/models/dd_254.py
Normal file
31
atst/models/dd_254.py
Normal file
@@ -0,0 +1,31 @@
|
||||
from sqlalchemy import Column, String
|
||||
from sqlalchemy.types import ARRAY
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
from atst.models import Base, types, mixins
|
||||
|
||||
|
||||
class DD254(Base, mixins.TimestampsMixin):
|
||||
__tablename__ = "dd_254s"
|
||||
|
||||
id = types.Id()
|
||||
|
||||
certifying_official = Column(String)
|
||||
co_title = Column(String)
|
||||
co_address = Column(String)
|
||||
co_phone = Column(String)
|
||||
required_distribution = Column(ARRAY(String))
|
||||
|
||||
task_order = relationship("TaskOrder", uselist=False, backref="task_order")
|
||||
|
||||
def to_dictionary(self):
|
||||
return {
|
||||
c.name: getattr(self, c.name)
|
||||
for c in self.__table__.columns
|
||||
if c.name not in ["id"]
|
||||
}
|
||||
|
||||
def __repr__(self):
|
||||
return "<DD254(certifying_official='{}', task_order='{}', id='{}')>".format(
|
||||
self.certifying_official, self.task_order.id, self.id
|
||||
)
|
@@ -49,6 +49,9 @@ class TaskOrder(Base, mixins.TimestampsMixin):
|
||||
so_id = Column(ForeignKey("users.id"))
|
||||
security_officer = relationship("User", foreign_keys="TaskOrder.so_id")
|
||||
|
||||
dd_254_id = Column(ForeignKey("dd_254s.id"))
|
||||
dd_254 = relationship("DD254")
|
||||
|
||||
scope = Column(String) # Cloud Project Scope
|
||||
defense_component = Column(String) # Department of Defense Component
|
||||
app_migration = Column(String) # App Migration
|
||||
|
Reference in New Issue
Block a user