def handles_process():
    if request.method == 'GET':
        utilities.set_order_by_limit_page('handles')
    if request.method == 'POST':
        utilities.set_filters('handles', filters.handles)
        if request.form['submit'] == 'delete':
            ids = request.form.getlist('ids')
            if ids:
                for id in ids:
                    g.mysql.delete(g.mysql.query(models.handle).get(id))
                    g.mysql.commit()
                flash('The selected handles were deleted successfully.', 'success')
            else:
                flash('Please select atleast one handle and try again.', 'failure')
    return redirect(url_for('administrators.handles_overview'))
예제 #2
0
def customers_process():
    if request.method == 'GET':
        utilities.set_order_by_limit_page('customers')
    if request.method == 'POST':
        utilities.set_filters('customers', filters.customers)
    return redirect(url_for('administrators.customers_overview'))
def visitors_process():
    if request.method == 'GET':
        utilities.set_order_by_limit_page('visitors')
    if request.method == 'POST':
        utilities.set_filters('visitors', filters.visitors)
    return redirect(url_for('administrators.visitors_overview'))