Пример #1
0
 def getCompanyName(self, short, lang):
     try:
         ret = CompanyInfo.find(company_short = short)
         
         if len(ret) == 1:
             if lang == 'zh':
                 return ret[0].company_zh   
         else:
             return ""
     except:
         msg = traceback.format_exc()
         self.logger.error(msg)
         
         DBBase.Session.rollback()
         DBBase.Engine.dispose()
         
         return None
Пример #2
0
    def getCompanyName(self, short, lang):
        try:
            ret = CompanyInfo.find(company_short=short)

            if len(ret) == 1:
                if lang == 'zh':
                    return ret[0].company_zh
            else:
                return ""
        except:
            msg = traceback.format_exc()
            self.logger.error(msg)

            DBBase.Session.rollback()
            DBBase.Engine.dispose()

            return None
Пример #3
0
 def getCompanyList(self, lang):
     try:
         ret = CompanyInfo.find()
         
         company_info_list = []
         for one in ret:
             one_hash = {}
             one_hash['short'] = one.company_short
             if lang == 'zh':
                 one_hash['full'] = one.company_zh
             
             company_info_list.append(one_hash)
         
         return company_info_list
     except:
         msg = traceback.format_exc()
         self.logger.error(msg)
         
         DBBase.Session.rollback()
         DBBase.Engine.dispose()
         
         return None
Пример #4
0
    def getCompanyList(self, lang):
        try:
            ret = CompanyInfo.find()

            company_info_list = []
            for one in ret:
                one_hash = {}
                one_hash['short'] = one.company_short
                if lang == 'zh':
                    one_hash['full'] = one.company_zh

                company_info_list.append(one_hash)

            return company_info_list
        except:
            msg = traceback.format_exc()
            self.logger.error(msg)

            DBBase.Session.rollback()
            DBBase.Engine.dispose()

            return None