On Thu, Jun 30, 2011 at 8:42 AM, Alessandro Molina <[email protected]> wrote: > One more thing, > the test case is currently testing for the autoescape extension, but there > is no test case for filters. > I think that it can be quickly achieved by adding a simple filter and > registering it in a test unit.
Done > I think that for extenions they are better managed in the configuration > file. > Filters, instead, might be a good candidate for being included in the > project and automatically loaded as I see them more related to helpers. > If we really want to do this we might consider creating a lib.something > module and handle all the template related extensions and functions there. > So that we will have lib.something.helpers, lib.something.jinja_filters, > lib.something.whatever and people know that for any template filter, helper > etc they can look there. > I just don't have any idea on how "lib.something" should be called, but I > think that it is better than putting everything in lib alone which might > bring us to have lib.this, lib.that, lib.future_idea caos. I don't really see people creating many custom extensions for each project, filters are more common. The thing is that helpers are loaded to the template context, be it variables, data or functions, filters in the other hand are functions too, they have a very specific function and way of working, in the end they more of a syntaxis thing for the template, they are functions that will always accept at least 1 value and do something and return a value, thus they have some overlap with helper functions. Maybe we could have a lib.templates?, thus we would end up with lib.templates.helpers and lib.templates.jinja_filters. Regards, Carlos Ruvalcaba -- You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/turbogears-trunk?hl=en.
