4bac44fd19a8b4a9222cdc1faadb019689cebb04
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
.lib
import helpers
as h
9 from spline
.lib
.base
import BaseController
, render
10 from spline
.lib
.plugin
.load
import run_hooks
12 log
= logging
.getLogger(__name__
)
14 class FrontPageController(BaseController
):
17 """Magicaltastic front page.
19 Plugins can register things to appear on it, somehow.
21 Local plugins can override the fairly simple index.mako template to
22 customize the front page layout.
24 # Hooks should return a list of FrontPageUpdate objects, making this
25 # return value a list of lists
26 updates_lol
= run_hooks('frontpage_updates', limit
=10)
27 updates
= sum(updates_lol
, [])
29 updates
.sort(key
=lambda obj
: obj
.time
)
31 c
.updates
= updates
[0:10]
33 return render('/index.mako')