2023-01-30 06:49:08 -05:00
|
|
|
"""
|
|
|
|
Model representation of an application
|
|
|
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
|
|
|
Copyright © 2022 Concordia CERC group
|
|
|
|
Project Coder Guille Gutierrez Guillermo.GutierrezMorote@concordia.ca
|
|
|
|
"""
|
|
|
|
|
|
|
|
import datetime
|
|
|
|
|
2023-01-31 13:11:39 -05:00
|
|
|
from sqlalchemy.dialects.postgresql import UUID
|
2023-01-30 06:49:08 -05:00
|
|
|
from sqlalchemy import Column, Integer, String, Sequence
|
|
|
|
from sqlalchemy import DateTime
|
|
|
|
|
|
|
|
|
2023-02-01 06:05:12 -05:00
|
|
|
class Application:
|
2023-01-30 06:49:08 -05:00
|
|
|
"""
|
|
|
|
A model representation of an application
|
|
|
|
"""
|
2023-02-01 06:05:12 -05:00
|
|
|
__table__ = "application"
|
2023-01-30 06:49:08 -05:00
|
|
|
id = Column(Integer, Sequence('application_id_seq'), primary_key=True)
|
|
|
|
name = Column(String, nullable=False)
|
|
|
|
description = Column(String, nullable=False)
|
2023-01-31 13:11:39 -05:00
|
|
|
application_uuid = Column(UUID(as_uuid=True), nullable=False)
|
2023-01-30 06:49:08 -05:00
|
|
|
created = Column(DateTime, default=datetime.datetime.utcnow)
|
|
|
|
updated = Column(DateTime, default=datetime.datetime.utcnow)
|
|
|
|
|
2023-01-31 13:11:39 -05:00
|
|
|
def __init__(self, name, description, application_uuid):
|
2023-01-30 06:49:08 -05:00
|
|
|
self.name = name
|
|
|
|
self.description = description
|
2023-01-31 13:11:39 -05:00
|
|
|
self.application_uuid = application_uuid
|