Пример #1
0
 def syncOddTable(self):
     self.connection.request("GET", "/sync/odd")
     response = self.connection.getresponse()
     data = json.loads(response.read())
     print response.read()
     if not data.has_key('up-to-date'):
         for odd in data['name']:
             try:
                 category = OddCategory.get(iid=int(odd['category']))
                 match = Match.get(iid=int(odd['match']))
                 Odd.create(iid=odd['iid'],odd=unicode(odd['odd']), category=category, oddCode=unicode(odd['oddCode']), match=match)
             except Exception, e:
                 print str(e) + "- Odd"
Пример #2
0
 def syncOddTable(self):
     self.connection.request("GET", "/sync/odd")
     response = self.connection.getresponse()
     data = json.loads(response.read())
     print response.read()
     if not data.has_key('up-to-date'):
         for odd in data['name']:
             try:
                 category = OddCategory.get(iid=int(odd['category']))
                 match = Match.get(iid=int(odd['match']))
                 Odd.create(iid=odd['iid'],
                            odd=unicode(odd['odd']),
                            category=category,
                            oddCode=unicode(odd['oddCode']),
                            match=match)
             except Exception, e:
                 print str(e) + "- Odd"