Example #1
0
 def syncOddCatTable(self):
     self.connection.request("GET", "/sync/oddcat")
     response = self.connection.getresponse()
     data = response.read()
     data = json.loads(data)
     print response.read()
     if not data.has_key('up-to-date'):
         for cat in data['name']:
             try:
                 OddCategory.create(iid=cat['iid'],name=cat['name'])
             except Exception, e:
                 print str(e) + "- OddCat"
Example #2
0
 def syncOddCatTable(self):
     self.connection.request("GET", "/sync/oddcat")
     response = self.connection.getresponse()
     data = response.read()
     data = json.loads(data)
     print response.read()
     if not data.has_key('up-to-date'):
         for cat in data['name']:
             try:
                 OddCategory.create(iid=cat['iid'], name=cat['name'])
             except Exception, e:
                 print str(e) + "- OddCat"