Source

PylonsWikiNG / src / models / tutorial / views.py

Full commit
from pylons.views import action
from tutorial.models import DBSession
from tutorial.models import Model

class MyController(object):
    def __init__(self, request):
        self.request = request

    @action(renderer='mytemplate.mak')
    def index(self):
        dbsession = DBSession()
        root = dbsession.query(Model).filter(Model.name==u'root').first()
        return {'root':root, 'project':'tutorial'}