def opsyscomponents(self): self.begin('Components') opsysobjs = self.ses.query(OpSys).all() for comp in data.COMPS: for obj in opsysobjs: if randutils.tosslow(): continue compobj = OpSysComponent(name=comp) compobj.opsys = obj for release in randutils.pickmost(obj.releases): release_assoc = OpSysReleaseComponent() release_assoc.release = release compobj.opsysreleases.append(release_assoc) self.add(compobj) self.commit()
def opsyscomponents(self): self.begin('Components') opsysobjs = self.ses.query(OpSys).all() for comp in data.COMPS.keys(): for obj in opsysobjs: if randutils.tosslow(): continue compobj = OpSysComponent(name=comp) compobj.opsys = obj for release in randutils.pickmost(obj.releases): release_assoc = OpSysReleaseComponent() release_assoc.release = release compobj.opsysreleases.append(release_assoc) self.add(compobj) self.commit()
def opsyscomponents(self) -> None: self.begin('Components') opsysobjs = self.ses.query(OpSys).all() for comp in data.COMPS: for obj in opsysobjs: if randutils.tosslow(): continue compobj = OpSysComponent(name=comp) compobj.opsys = obj for release in randutils.pickmost(obj.releases): release_assoc = OpSysReleaseComponent() release_assoc.release = release # OpSysComponent.releases is a backref from OpSysReleaseComponent. compobj.releases.append(release_assoc) # pylint: disable=no-member self.add(compobj) self.commit()