Latest Version: 0.9.6.2

Warning

This documentation does not refer to the most recent version of Pylons. Current Documentation

helpers

"Magic" helper objects (session, request, m) and etag_cache

Additional helper object available for use in Controllers is the etag_cache.

These helper objects provide convenient proxy access to the thread-local objects a web developer will want to use frequently. Any thread-local object can easily be proxy'd by sub-classing ObjectProxy and providing a _get_object method that will retrieve the desired thread-local for access.


Functions

f etag_cache(key=None) ...

Use the HTTP Entity Tag cache for Browser side caching

If a "If-None-Match" header is found, and equivilant to key, then a 304 HTTP message will be returned with the ETag to tell the browser that it should use its current cache of the page.

Otherwise, the ETag header will be added to the response for use in future request cycles.

Suggested use is within a Controller Action like so:

import pylons

class YourController(BaseController):
    def index(self):
        if pylons.etag_cache(key=1): return
        m.subexec('/splash.myt')

Classes

C SessionProxy(...) ...

Retrieves the session thread-local from the Myghty request

This class contains 5 members.

C RequestProxy(...) ...

Retrieves the http request object from the Myghty request

This class contains 5 members.

C MyghtyProxy(...) ...

Retrieves the Myghty request object from the Myghty thread-local

This class contains 5 members.

C GlobalsProxy(...) ...

Retrieves the environ globals var pylons.g

This class contains 5 members.

C RequestArgProxy(...) ...

Retrieves the request args from the Myghty request object

This class contains 5 members.

See the source for more information.

Top