From e34c33088c00ceae430ad4cc4761e43e37a9f6f6 Mon Sep 17 00:00:00 2001 From: Nathan Swain Date: Wed, 17 Jul 2024 15:16:14 -0600 Subject: [PATCH] Add back_populates to event manager relationships --- gsshapy/orm/evt.py | 2 +- gsshapy/orm/prj.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gsshapy/orm/evt.py b/gsshapy/orm/evt.py index 9b3c715..c5e79c4 100644 --- a/gsshapy/orm/evt.py +++ b/gsshapy/orm/evt.py @@ -14,8 +14,8 @@ class ProjectFileEventManager(DeclarativeBase, GsshaPyFileObjectBase): id = Column(Integer, autoincrement=True, primary_key=True) #: PK project_file_id = Column(Integer, ForeignKey('prj_project_files.id')) - projectFile = relationship('ProjectFile') fileExtension = Column(String, default='yml') + projectFile = relationship('ProjectFile', back_populates='projectFileEventManager') events = relationship('ProjectFileEvent', lazy='dynamic', cascade="save-update,merge,delete,delete-orphan") #: RELATIONSHIP diff --git a/gsshapy/orm/prj.py b/gsshapy/orm/prj.py index ebdb7c2..0640e39 100644 --- a/gsshapy/orm/prj.py +++ b/gsshapy/orm/prj.py @@ -107,7 +107,8 @@ class ProjectFile(DeclarativeBase, GsshaPyFileObjectBase): linkNodeDatasets = relationship('LinkNodeDatasetFile', back_populates='projectFile') #: RELATIONSHIP genericFiles = relationship('GenericFile', back_populates='projectFile') #: RELATIONSHIP wmsDatasets = relationship('WMSDatasetFile', back_populates='projectFile') #: RELATIONSHIP - projectFileEventManager = relationship('ProjectFileEventManager', uselist=False) #: RELATIONSHIP + projectFileEventManager = relationship('ProjectFileEventManager', back_populates='projectFile', + uselist=False) #: RELATIONSHIP # File Properties MAP_TYPES_SUPPORTED = (1,)