def index(request): """ list groups """ dbh = get_dbhandler() groups = Group.query(dbh.session()) html, code = format_grouptable(groups, request) if request.user.has_roles(SYSADM): add_button = ( 'New group', request.route_url('rhombus.group-edit', id=0) ) bar = selection_bar('group-ids', action=request.route_url('rhombus.group-action'), add = add_button) html, code = bar.render(html, code) return render_to_response('rhombus:templates/group/index.mako', { 'html': html, 'code': code, }, request=request )