lib Documentation

app_globals

The application’s Globals object http://stackoverflow.com/questions/3458344/turbomail-3-with-pylons-1-0-mailnotenabledexception

class inphosite.lib.app_globals.Globals(config)[source]

Globals acts as a container for objects available throughout the life of the application

auth

class inphosite.lib.auth.UserModelPlugin[source]
add_metadata(environ, identity)[source]
authenticate(environ, identity)[source]

Return username or None.

inphosite.lib.auth.authorize(permission)[source]

This is a decorator which can be used to decorate a Pylons controller action. It takes the permission to check as the only argument and can be used with all types of permission objects.

inphosite.lib.auth.custom_request_classifier(environ)[source]

Returns one of the classifiers ‘app’, ‘browser’ or any standard classifiers returned by repoze.who.classifiers:default_request_classifier

inphosite.lib.auth.encrypt(password, secret='')[source]

Encryption function for use on passwords

Takes a cookie authorization and decodes it to find the username. Does some validation against the requesting IP address. Raises a ValueError if they do not match the request.

inphosite.lib.auth.is_admin()[source]
inphosite.lib.auth.is_logged_in()[source]
inphosite.lib.auth.uid(request)[source]
inphosite.lib.auth.user_exists(username)[source]
inphosite.lib.auth.username(request)[source]

base

helpers

jweight

inphosite.lib.jweight.create_tuple(edge)[source]
inphosite.lib.jweight.form_tuples(edges)[source]

multi_get

class inphosite.lib.multi_get.URLThread(url)[source]
run()[source]
inphosite.lib.multi_get.multi_get(uris, timeout=2.5)[source]

rest

REST decorators

inphosite.lib.rest.dispatch_on(**method_map)[source]

Dispatches to alternate controller methods based on HTTP method

Multiple keyword arguments should be passed, with the keyword corresponding to the HTTP method to dispatch on (DELETE, POST, GET, etc.) and the value being the function to call. The value should be a string indicating the name of the function to dispatch to.

Example:

from pylons.decorators import rest

class SomeController(BaseController):

    @rest.dispatch_on(POST='create_comment')
    def comment(self):
        # Do something with the comment

    def create_comment(self, id):
        # Do something if its a post to comment
inphosite.lib.rest.restrict(*methods)[source]

Restricts access to the function depending on HTTP method

Example:

from pylons.decorators import rest

class SomeController(BaseController):

    @rest.restrict('GET')
    def comment(self, id):

Table Of Contents

Previous topic

controllers Documentation

Next topic

module Documentation

This Page