Esempio n. 1
0
def display_admin_pages(page):
    if user.is_admin():
        lim = (-config.PAGE + page * config.PAGE, page * config.PAGE)
        result = database.get_pages(limit=lim)
        pages = [dict(title=row[0], slug=row[1])
                    for row in result]
        return render_admin_page('admin_pages.html',
                                 a_pages=pages,
                                 pg=page,
                                 num_pages=database.get_num_pages())
    else:
        return redirect(url_for('display_news'))
Esempio n. 2
0
def get_pages():
    result = database.get_pages()
    return [dict(title=row[0], slug=row[1])for row in result]