Public Member Functions | |
def | __init__ |
def | css_files |
def | embedded_css |
def | embedded_javascript |
def | html_body |
def | html_head |
def | javascript_files |
def | render |
Private Member Functions | |
def | _get_resources |
Private Attributes | |
_resource_dict | |
_resource_list |
UIModule that simply renders the given template. {% module Template("foo.html") %} is similar to {% include "foo.html" %}, but the module version gets its own namespace (with kwargs passed to Template()) instead of inheriting the outer template's namespace. Templates rendered through this module also get access to UIModule's automatic javascript/css features. Simply call set_resources inside the template and give it keyword arguments corresponding to the methods on UIModule: {{ set_resources(js_files=static_url("my.js")) }} Note that these resources are output once per template file, not once per instantiation of the template, so they must not depend on any arguments to the template.
def tornado.web.TemplateModule.__init__ | ( | self, | |
handler | |||
) |
Reimplemented from tornado.web.UIModule.
def tornado.web.TemplateModule._get_resources | ( | self, | |
key | |||
) | [private] |
def tornado.web.TemplateModule.css_files | ( | self | ) |
Returns a list of CSS files required by this module.
Reimplemented from tornado.web.UIModule.
def tornado.web.TemplateModule.embedded_css | ( | self | ) |
Returns a CSS string that will be embedded in the page.
Reimplemented from tornado.web.UIModule.
def tornado.web.TemplateModule.embedded_javascript | ( | self | ) |
Returns a JavaScript string that will be embedded in the page.
Reimplemented from tornado.web.UIModule.
def tornado.web.TemplateModule.html_body | ( | self | ) |
Returns an HTML string that will be put in the <body/> element
Reimplemented from tornado.web.UIModule.
def tornado.web.TemplateModule.html_head | ( | self | ) |
Returns a CSS string that will be put in the <head/> element
Reimplemented from tornado.web.UIModule.
def tornado.web.TemplateModule.javascript_files | ( | self | ) |
Returns a list of JavaScript files required by this module.
Reimplemented from tornado.web.UIModule.
def tornado.web.TemplateModule.render | ( | self, | |
args, | |||
kwargs | |||
) |
Overridden in subclasses to return this module's output.
Reimplemented from tornado.web.UIModule.