[ckan-dev] cleaning helpers

Toby Dacre toby.okfn at gmail.com
Wed Mar 28 10:36:25 UTC 2012


Hi,

I've been doing some cleanups to remove unused functions from h passed to
templates.

There is now a new config option `ckan.restrict_template_vars` if this is
set it will only allow a restricted set of functions.  Also functions that
required c to be passed eg h.nav_link() no longer accept this and should be
called without c as a parameter (will raise an exception).

If not set then we are all as usual and functions like nav_link() can be
called with or without c being passed.

This means we can start transitioning to a cleaner setup without breaking
existing templates etc but we can also test the strict new rules.

the allowed functions are in lib/helpers_clean.py (and yes I have done a
from ... import ...) I would like to see us transition to forcing using
cleaner template vars as soon as practical.

this is merged into master

cheers
Toby
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20120328/83dc5ae3/attachment.html>


More information about the ckan-dev mailing list