#2537: add *args support to filters (or provide a proper error message) -------------------------------+-------------------------------------------- Reporter: [EMAIL PROTECTED] | Owner: adrian Type: enhancement | Status: new Priority: normal | Milestone: Component: Template system | Version: SVN Severity: normal | Keywords: -------------------------------+-------------------------------------------- Not sure if this should be an enhancement or a (doc) bug. Currently you can not have a filter which takes *args. The filter function introspection (in FilterExpression.args_check) does not check for *args (or **kwdargs). As a result, it thinks that there are 0 args required, and errors if any are passed in. If the function in question does require some arguments, you get that error if you pass in nothing (the only way to get past args_check). args_check COULD error if *args is present and no other args are present, but that has other issues. This is causing me a headache due to the following: {{{ #!python @register.filter @threadsafe def not_thread_safe_filter(object, fmt): ## ... not mod_python thread safe code }}} This will hold true for all the generic decorators like threadsafe which just use (*args, **kwdargs). The obvious 'fix' would be to put the code from @threadsafe into the filter, which is what I have had to do, but that is a weak argument. At the very least the doc needs to be patched to mention this issue.
-- Ticket URL: <http://code.djangoproject.com/ticket/2537> Django <http://code.djangoproject.org/> The web framework for perfectionists with deadlines. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-updates -~----------~----~----~----~------~----~------~--~---