Beispiel #1
0
    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))
Beispiel #2
0
	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))	
Beispiel #3
0
    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))
Beispiel #4
0
 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))