[ckan-dev] cleaning helpers

Toby Dacre toby.okfn at gmail.com
Wed Mar 28 10:51:21 UTC 2012


On 28 March 2012 11:50, Toby Dacre <toby.okfn at gmail.com> wrote:

>
>
> On 28 March 2012 11:44, Ross Jones <ross.jones at okfn.org> wrote:
>
>> Hi Toby,
>>
>> That's great, definitely worth doing.  Might it be worth setting a
>> timescale for the changes? i.e. try and get them cleaned up for 1.6.2
>> rather than it dragging out?
>>
>
> my plan would be to have the default off in 6.2 and switch the default to
> on in 6.3 and fully remove them in 6.4
>

these are pseudo versions prob 1.7, 1.8 etc

>
>
>>
>> Whilst you're fixing up the stuff in lib/ I don't support there is any
>> chance of you fixing up render() and splitting it out into render() and
>> render_text() as currently whenever I want to use a text template I need to
>> mess about with genshi loader classes in an extension, and that's nasty.
>>
>> I'll look at this and get back to you
>
> Toby
>
>
>> Ross.
>>
>> On 28 Mar 2012, at 11:36, Toby Dacre wrote:
>>
>> > 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
>> > _______________________________________________
>> > ckan-dev mailing list
>> > ckan-dev at lists.okfn.org
>> > http://lists.okfn.org/mailman/listinfo/ckan-dev
>>
>>
>> _______________________________________________
>> ckan-dev mailing list
>> ckan-dev at lists.okfn.org
>> http://lists.okfn.org/mailman/listinfo/ckan-dev
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20120328/1e8580c7/attachment-0001.html>


More information about the ckan-dev mailing list