def get(self): tipo = self.request.get("tipo") helper = PersistenceHelper() topDiputados = helper.getTopDiputadosIniciativas(500, tipo) downDiputados = helper.getDownDiputadosIniciativas(500, tipo) for d in downDiputados: if d.numero_iniciativas_pendientes == None: d.numero_iniciativas_pendientes = 0 if d.numero_iniciativas_aprobadas == None: d.numero_iniciativas_aprobadas = 0 if d.numero_iniciativas_desechadas == None: d.numero_iniciativas_desechadas = 0 for d in topDiputados: if d.numero_iniciativas_pendientes == None: d.numero_iniciativas_pendientes = 0 if d.numero_iniciativas_aprobadas == None: d.numero_iniciativas_aprobadas = 0 if d.numero_iniciativas_desechadas == None: d.numero_iniciativas_desechadas = 0 template_values = { "topDiputados": topDiputados, "downDiputados": downDiputados, "tipo": tipo } path = os.path.join(os.path.dirname(__file__), 'diputados.html') self.response.out.write(template.render(path, template_values))
def get(self): helper = PersistenceHelper() uuid = self.request.get("id") d = helper.findDiputadoById(uuid) r = helper.findIniciativasByDiputado(uuid) template_values = {"diputado": d, "iniciativas": r} path = os.path.join(os.path.dirname(__file__), 'iniciativas.html') self.response.out.write(template.render(path, template_values))
def get(self): helper = PersistenceHelper() uuid = self.request.get("id") d = helper.findDiputadoById(uuid) if d.numero_iniciativas == None: d.numero_iniciativas = 0 if d.numero_iniciativas_pendientes == None: d.numero_iniciativas_pendientes = 0 if d.numero_iniciativas_aprobadas == None: d.numero_iniciativas_aprobadas = 0 if d.numero_iniciativas_desechadas == None: d.numero_iniciativas_desechadas = 0 template_values = {"diputado": d} path = os.path.join(os.path.dirname(__file__), 'diputado.html') self.response.out.write(template.render(path, template_values))
def get(self): helper = PersistenceHelper() topDiputados = helper.getTopDiputadosIniciativas( 10, "numero_iniciativas") downDiputados = helper.getDownDiputadosIniciativas( 10, "numero_iniciativas") for d in downDiputados: if d.numero_iniciativas == None: d.numero_iniciativas = 0 template_values = { "topDiputados": topDiputados, "downDiputados": downDiputados, "tipo": "presentadas" } path = os.path.join(os.path.dirname(__file__), 'index.html') self.response.out.write(template.render(path, template_values))
def get(self): helper = PersistenceHelper() helper.deleteAllInCache()