@expenses.route('/export/expenses/')
@expenses.route('/export/expenses/for/<date>')
@expenses.route('/export/expenses/in/<category>')
@expenses.route('/export/expenses/page/<int:page>')
@expenses.route('/export/expenses/for/<date>/in/<category>')
@expenses.route('/export/expenses/for/<date>/page/<int:page>')
@expenses.route('/export/expenses/in/<category>/page/<int:page>')
@expenses.route('/export/expenses/for/<date>/in/<category>/page/<int:page>')
@login_required
def export(date=None, category=None, page=1, items_per_page=10):

    model = Expenses(session.get('logged_in_user'))

    dict = entries.index(**locals())
    for key in dict.keys(): exec(key + " = dict['" + key + "']")

    response = make_response(render_template('admin_export_expenses.html', **locals()))
    response.headers['Content-type'] = 'text/csv'
    response.headers['Content-disposition'] = 'attachment;filename=' + 'expenses-' + str(today_date()) + '.csv'
    return response
Export expenses on a filter
dataset/ETHPy150Open radekstepan/FlaskBudget/presenters/expenses.py/export