You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
805 B
Python
23 lines
805 B
Python
|
|
from sqlalchemy import UUID, Column, Float, Integer, String, ForeignKey
|
|
from src.database.core import Base
|
|
from src.models import DefaultMixin, IdentityMixin, TimeStampMixin
|
|
from sqlalchemy.orm import relationship
|
|
from src.workorder.model import MasterWorkOrder
|
|
from sqlalchemy.ext.hybrid import hybrid_property
|
|
|
|
|
|
class ScopeEquipmentJob(Base, DefaultMixin):
|
|
__tablename__ = "oh_ms_scope_equipment_job"
|
|
|
|
assetnum = Column(String, nullable=False)
|
|
job_id = Column(UUID(as_uuid=True), ForeignKey(
|
|
"oh_ms_job.id", ondelete="cascade"))
|
|
|
|
master_equipments = relationship(
|
|
"MasterEquipment", lazy="raise", primaryjoin="and_(ScopeEquipmentJob.assetnum == foreign(MasterEquipment.assetnum))", uselist=False)
|
|
|
|
job = relationship(
|
|
"MasterActivity", lazy="selectin"
|
|
)
|