def showcontroller(city_id, num):
    c = queries.get_controller(city_id, num)
    a = queries.get_alerts_with_count().filter(models.Alert.city_id==city_id).filter(models.Alert.controller_id==num).order_by(models.Alert.time.desc()).limit(200)
    return render_template('controllers.html', controller=c, title='Controller %d' % c.id, navlinks=navlinks, city=city_id, alerts=a)
def showcontroller(city_id, num):
    c = queries.get_controller(city_id, num)
    return render_template('controllers.html', controller=c, title='Controller %d' % c.id, navlinks=navlinks, city=city)