3 from pylons
import config
, request
, response
, session
, tmpl_context
as c
, url
4 from pylons
.controllers
.util
import abort
, redirect_to
5 from routes
import request_config
6 from sqlalchemy
.orm
.exc
import NoResultFound
8 from spline
import model
9 from spline
.model
import meta
10 from spline
.lib
import helpers
as h
11 from spline
.lib
.base
import BaseController
, render
13 log
= logging
.getLogger(__name__
)
15 class ForumController(BaseController
):
18 c
.forums
= meta
.Session
.query(model
.Forum
).order_by(model
.Forum
.id.asc())
19 return render('/forum/forums.mako')
21 def threads(self
, forum_id
):
23 c
.forum
= meta
.Session
.query(model
.Forum
).get(forum_id
)
27 return render('/forum/threads.mako')
29 def posts(self
, forum_id
, thread_id
):
31 c
.thread
= meta
.Session
.query(model
.Thread
) \
32 .filter_by(id=thread_id
, forum_id
=forum_id
).one()
36 return render('/forum/threads.mako')