93eaed44412bfc4e5066d304d69460e80917ed5a
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
.model
import meta
9 from spline
.lib
import helpers
as h
10 from spline
.lib
.base
import BaseController
, render
11 from splinext
.forum
import model
as forum_model
13 log
= logging
.getLogger(__name__
)
15 class ForumController(BaseController
):
18 c
.forums
= meta
.Session
.query(forum_model
.Forum
) \
19 .order_by(forum_model
.Forum
.id.asc())
20 return render('/forum/forums.mako')
22 def threads(self
, forum_id
):
24 c
.forum
= meta
.Session
.query(forum_model
.Forum
).get(forum_id
)
28 c
.threads
= c
.forum
.threads
30 return render('/forum/threads.mako')
32 def posts(self
, forum_id
, thread_id
):
34 c
.thread
= meta
.Session
.query(forum_model
.Thread
) \
35 .filter_by(id=thread_id
, forum_id
=forum_id
).one()
39 return render('/forum/posts.mako')