Exemplo n.º 1
0
Arquivo: casan.py Projeto: knabben/xt
 def seg_via(self, response):
     for i in json.loads(response.body):
         data = Transactions()
         if int(i.get("situation_id")):
             data["paid"] = True
         else:
             data["paid"] = False
         data["value"] = float(i.get("value"))
         data["expire"] = datetime.strptime(i.get("reference_date"), "%m-%d-%Y")
         data["crawl_date"] = datetime.now()
         data["service"] = Service.objects.get(pk=int(self.service))
         data.save()