3 from pylons
import request
, response
, session
, tmpl_context
as c
, app_globals
as g
4 from pylons
.controllers
.util
import abort
, redirect_to
6 from fma
.orm
import mapper
7 from townsquare
.model
.post
import Post
8 from townsquare
.model
.user
import User
9 from townsquare
.lib
.base
import BaseController
, render
11 log
= logging
.getLogger(__name__
)
13 #mapper(User, Discussion)
15 class UserController(BaseController
):
17 def view(self
, idname
):
18 c
.user
= g
.db
.col(User
).find_one(idname
=idname
)
19 wallposts
= g
.db
.col(Post
).find(host_classname
='User', host_id
=c
.user
._id
)
21 c
.user
.posts
= wallposts
.sort(**order
)
22 return render('/user/view.mako')
25 c
.item_list
= g
.db
.col(User
).find()
26 return render('/user/list.mako')