def create_method(self, description, link): meth = Method() meth.description = description if link is not None: meth.link = link self._edit_session.add(meth) self._edit_session.commit() return meth
def create_method(self, description, link): """ :param description: :param link: :return: """ meth = Method() meth.description = description if link is not None: meth.link = link self._edit_session.add(meth) self._edit_session.commit() return meth
def getMethod(self): m = Method() if self.rbGenerate.Value: genmethod = "Values derived from ODM Tools Python" try: m = self.series_service.get_method_by_description(genmethod) except: m.description = genmethod elif self.rbSelect.Value: index = self.lstMethods.GetFirstSelected() desc = self.lstMethods.GetItem(index, 0).GetText() logger.debug(desc) m = self.series_service.get_method_by_description(desc) elif self.rbCreateNew.Value: m.description = self.txtMethodDescrip.GetValue() return m
def getMethod(self): m = Method() if self.rbGenerate.Value: genmethod = "Values derived from ODM Tools Python" try: m= self.series_service.get_method_by_description(genmethod) except: m.description = genmethod elif self.rbSelect.Value: index = self.lstMethods.GetFirstSelected() desc= self.lstMethods.GetItem(index, 0).GetText() logger.debug(desc) m= self.series_service.get_method_by_description(desc) elif self.rbCreateNew.Value: m.description = self.txtMethodDescrip.GetValue() return m
def getMethod(self): m = Method() if self.rbGenerate.Value: genmethod = "Values derived from ODM Tools Python" m = self.series_service.get_method_by_description(genmethod) if m is None: logger.debug("assigning new method description") m = Method() m.description = genmethod elif self.rbSelect.Value: index = self.lstMethods.GetFirstSelected() # desc = self.lstMethods.GetItem(index, 0).GetText() id = self.lstMethods.GetItem(index, 2).GetText() logger.debug(id) m = self.series_service.get_method_by_id(int(id)) elif self.rbCreateNew.Value: logger.debug("assigning new method description") m.description = self.txtMethodDescrip.GetValue() return m