timmie / web2jinja

web2py controller decorator that returns Jinja2 compiled template string.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

web2jinja

web2py controller decorator that returns Jinja2 compiled template string.

Usage

Place this file under your web2py applications/myapp/modules.

# myapp/controllers/somecontroller.py

from applications.myapp.modules.web2jinja import Web2Jinja

@Web2Jinja(request)
def index():
    return {
        'foo': 'bar',
    }

will render same view file i.e. applications/myapp/views/somecontroller/index.html by using Jinja2!

License

The MIT License (MIT) Copyright (c) <2012> http://www.opensource.org/licenses/mit-license.php

About

web2py controller decorator that returns Jinja2 compiled template string.