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()
     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))
Beispiel #4
0
	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))			
Beispiel #5
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 #6
0
    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))
Beispiel #7
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 #8
0
	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))	
Beispiel #9
0
 def get(self):
     helper = PersistenceHelper()
     helper.deleteAllInCache()
Beispiel #10
0
	def get(self):
		helper 	= PersistenceHelper()
		helper.deleteAllInCache()