Ejemplo n.º 1
0
def index(date=None, category=None, page=1, items_per_page=10):
    '''List expenses for the user'''

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

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

    return render_template('admin_show_expenses.html', **locals())
Ejemplo n.º 2
0
def index(date=None, category=None, page=1, items_per_page=10):
    '''List income entries for the user'''

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

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

    return render_template('admin_show_income.html', **locals())
Ejemplo n.º 3
0
def export(date=None, category=None, page=1, items_per_page=10):
    '''Export expenses on a filter'''

    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
Ejemplo n.º 4
0
def export(date=None, category=None, page=1, items_per_page=10):
    '''Export income entries on a filter'''

    model = Income(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_income.html', **locals()))
    response.headers['Content-type'] = 'text/csv'
    response.headers[
        'Content-disposition'] = 'attachment;filename=' + 'income-' + str(
            today_date()) + '.csv'
    return response