lck.django 0.8.5 documentation
Various unrelated routines and helper classes.
A smarter redirect which takes the redirection target from a given param. The lookup for the redirection target is as follows:
If override_request is True, link is always followed.
Renders the context within for a request using a template named template_name returning the required mimetype.
Dumps the object in the obj param to a JSON string and returns it via HTTP using the application/json mimetype.
A handler for a typical form workflow:
Like commit_on_success, but doesn’t commit existing transactions.
This decorator is used to run a function within the scope of a database transaction, committing the transaction on success and rolling it back if an exception occurs.
Unlike the standard transaction.commit_on_success decorator, this version first checks whether a transaction is already active. If so then it doesn’t perform any commits or rollbacks, leaving that up to whoever is managing the active transaction.
Taken from: http://djangosnippets.org/snippets/1343/
Cuts text to a predefined length and appends a trailing ellipsis for longer sources.
alias of chain
Note
The legacy lazy_chain name will be removed in lck.django 1.0. Use dj.chain.
If the remote address in request is a localhost, check for X_FORWADED_FOR. Which addresses are considered local is defined by the INTERNAL_IPS list in settings.py, by default these are 127.0.0.1, ::1 and “localhost”.