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.
20 lines
695 B
Python
20 lines
695 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 ScopeEquipmentPart(Base, DefaultMixin):
|
|
__tablename__ = "oh_tr_scope_equipment_part"
|
|
|
|
assetnum = Column(String, nullable=False)
|
|
stock = Column(Integer, nullable=False, default=0)
|
|
|
|
master_equipments = relationship(
|
|
"MasterEquipment", lazy="raise", primaryjoin="and_(ScopeEquipmentPart.assetnum == foreign(MasterEquipment.assetnum))", uselist=False)
|
|
|
|
|