def my_view(request): dbsession = DBSession() result = dbsession.execute(sa.text("select vehicle_type, count(*) as total_number from appliances group by vehicle_type order by 2")) vehicle_type = request.params.getall('vehicle_type') filters = { 'vehicle_type': vehicle_type, } return {'result':result, 'filters': filters}
def details_reference(request, reference): dbsession = DBSession() result = dbsession.execute(sa.text("select name, purpose from app_measure --where reference =%s ")) print "THIS IS A REFERENCE --> " +str(reference) return {'project':'ruop', 'result': result, 'reference': reference}