コード例 #1
0
ファイル: DBUtility.py プロジェクト: xulin97/FlightDaemon
 def putAirline(self, airline_list):
     try:
         for one in airline_list:
             ret = one.split('-')
             
             airline = AirlineInfo()
             airline.takeoff_city = ret[0]
             airline.arrival_city = ret[1]
             airline.add()
     except:
         msg = traceback.format_exc()
         self.logger.error(msg)
         
         DBBase.Session.rollback()
         DBBase.Engine.dispose()
         
         return None
コード例 #2
0
ファイル: DBUtility.py プロジェクト: xulin97/FlightDaemon
 def getAirlineList(self):
     try:
         ret = AirlineInfo.find()
         
         airline_list = []
         for one in ret:
             hash = {} #@ReservedAssignment
             hash['takeoff_city'] = one.takeoff_city
             hash['arrival_city'] = one.arrival_city
             airline_list.append(hash)
         
         return airline_list
     except:
         msg = traceback.format_exc()
         self.logger.error(msg)
         
         DBBase.Session.rollback()
         DBBase.Engine.dispose()
         
         return None
コード例 #3
0
    def getAirlineList(self):
        try:
            ret = AirlineInfo.find()

            airline_list = []
            for one in ret:
                hash = {}  #@ReservedAssignment
                hash['takeoff_city'] = one.takeoff_city
                hash['arrival_city'] = one.arrival_city
                airline_list.append(hash)

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

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

            return None
コード例 #4
0
    def putAirline(self, airline_list):
        try:
            for one in airline_list:
                ret = one.split('-')

                airline = AirlineInfo()
                airline.takeoff_city = ret[0]
                airline.arrival_city = ret[1]
                airline.add()
        except:
            msg = traceback.format_exc()
            self.logger.error(msg)

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

            return None