diff --git a/pa_job_manager.py b/pa_job_manager.py index c2e2edf..81831b9 100644 --- a/pa_job_manager.py +++ b/pa_job_manager.py @@ -108,10 +108,9 @@ class Path(Base): type = relationship("PathType") path_prefix = Column(String, unique=True, nullable=False ) num_files = Column(Integer) - dir_obj = relationship("Dir", secondary="path_dir_link", uselist=False) def __repr__(self): - return f"" + return f"" class Dir(Base): __tablename__ = "dir" @@ -718,7 +717,7 @@ def JobImportDir(job): path_obj.num_files=overall_file_cnt # this is needed so that later on, when we AddDir for any dirs we find via os.walk, they have a parent dir object that is the dir for the path we are in - parent_dir=path_obj.dir_obj + parent_dir=session.query(Dir).join(PathDirLink).join(Path).filter(Path.id==path_obj.id,Dir.rel_path=='').first() # first time through we need dir to be the top level, we have a special if below to no recreate the top dir that AddPath created already dir=parent_dir