1a79c1540c1bc23b76c4044daf6f3e40c10f5ec3
3 from pylons
import request
, response
, session
, tmpl_context
as c
4 from pylons
.controllers
.util
import abort
, redirect_to
5 from sqlalchemy
import func
6 from sqlalchemy
.orm
.exc
import NoResultFound
8 from floof
.lib
.base
import BaseController
, render
9 from floof
.model
.users
import User
, UserRelationship
11 log
= logging
.getLogger(__name__
)
13 class UsersController(BaseController
):
16 """List of all users."""
19 c
.users
= User
.query
.all()
21 return render('/users/index.mako')
27 c
.this_user
= User
.query
.filter(func
.lower(User
.name
) == name
) \
32 rels
= UserRelationship
.query
.filter_by(
34 target_user_id
=c
.this_user
.id,
37 c
.relationships
= [_
.type for _
in rels
]
39 return render('/users/view.mako')