@nocache
def status():
    form = MartaRouteStatusForm(request.form)

    context = {
        'title': 'Check MARTA Bus Status',
        'description': 'Check the current status of MARTA Buses on any route',
        'form': form
    }

    if request.method == 'POST' and form.validate():
        try:
            context['route'] = Route.objects.get(name=form.route.data)
            print context['route']
        except Route.DoesNotExist:
            flash('Oops! An error occurred looking up route %s' % form.route.data, 'error')

    return render_template('marta/realtime.html', **context)
dataset/ETHPy150Open shaunduncan/breezeminder/breezeminder/views/marta.py/status/original