Skip to content

web2py controller decorator that returns Jinja2 compiled template string.

Notifications You must be signed in to change notification settings

kirpit/web2jinja

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

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(locals())
def index():
    return {
        'foo': 'bar',
    }

will render same view file i.e. applications/myapp/views/somecontroller/index.html
by using Jinja2! It will include all the global variables such as request,
response, session, cache and other helpers but only "ON" boolean helper will be missing.

License

The MIT License (MIT)
Copyright (c) 2012 Roy Enjoy a.k.a. kirpit
http://www.opensource.org/licenses/mit-license.php

About

web2py controller decorator that returns Jinja2 compiled template string.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages