Esempio n. 1
0
def view_canon(context, request):
    datatables.need()
    try:
        canon = DBSession().query(Canon).get(request.matchdict.get('id'))
    except SQLAlchemyError:
        raise HTTPNotFound
    if not canon:
        raise HTTPNotFound
    return {'request': request,
            'canon': canon,
            'main': get_renderer('templates/master.pt').implementation()}
Esempio n. 2
0
def list_groups(context, request):
    datatables.need()
    groups = DBSession().query(Group).filter_by(state=u'aktywna').order_by(Group.name)
    return {'request': request,
            'groups': groups,
            'main': get_renderer('templates/master.pt').implementation()}
Esempio n. 3
0
def my_books(context, request):
    datatables.need()
    groups = request.user.groups
    return {'request': request,
            'groups': groups,
            'main': get_renderer('templates/master.pt').implementation()}
Esempio n. 4
0
def list_books(context, request):
    datatables.need()
    books = DBSession().query(Book).order_by(Book.title)
    return {'request': request,
            'books': books,
            'main': get_renderer('templates/master.pt').implementation()}
Esempio n. 5
0
def list_canons(context, request):
    datatables.need()
    canons = DBSession().query(Canon).order_by(Canon.title)
    return {'request': request,
            'canons': canons,
            'main': get_renderer('templates/master.pt').implementation()}