Hello there, I'm interested in allowing a particular filter I have to check the context. Trolling for reasons for and against, and if it makes no difference I'll file a ticket and provide some patches.
Its useful for me in cases where the thing I am processing has already been processed before. Take for example a wikification filter, which converts the string "[[some name]]" into "<a href="url_to_some_object">some name</a>". {{ comments.comment | mark_safe | markdown | wikification }} I don't want to hit the database twice in situations where wikification has already called upon a particular model instance, so as I'm processing comments its nice to build a dictionary in the context as a cache. However, since tags and not filters are privvy to the context, currently, I'm stuck with throwing out all these neat filters, and wrapping their functionality in a tag. The culrpit class is FilterExpression.resolve(). If I read it right, its already manipulating the context anyway so there's no additional load to pass it optionally to the filter function, if it asks. -Steve -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-develop...@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.