{% some_tag [positional_args] [named_args] *args **kwargs %}
where args is a list, kwargs is a dict?Hi Przemek,I'm not entirely certain I understand what you're proposing here. simple_tag, inclusion_tag and assignment_tag are all utility classes that you use to produce template tags; however, all the "native" template tags have their own implementations - which includes, for the most part, their own parsing infrastructure.Note that I'm not necessarily defending this arrangement -- In the past, this has been the cause of inconsistencies in argument handling between tags. However, it is the status quo, and it needs to be taken into account - if only because The side effect of this arrangement is that any custom template tags out there are relying on the fact that variable resolution *doesn't* happen in the render phase - at least, not in any automated or semi-automated way.
So - at a high level API level, what you are suggesting sounds interesting - *args and **kwargs are a powerful mechanism in python, and I can see how they might be useful in the context of template tags as a general feature - but I'm not sure I see how this would manifest in practice. The only two approaches I can see are:1) a backwards incompatible change at the root level of template tag design, or2) a manual change to each of Django's internal template tags - which would represent a lot of code churn to satisfy a use case that isn't entirely clear.Are you able to clarify how you would see this change happening in practice?
Hi Przemek,I'm not entirely certain I understand what you're proposing here. simple_tag, inclusion_tag and assignment_tag are all utility classes that you use to produce template tags; however, all the "native" template tags have their own implementations - which includes, for the most part, their own parsing infrastructure.Note that I'm not necessarily defending this arrangement -- In the past, this has been the cause of inconsistencies in argument handling between tags. However, it is the status quo, and it needs to be taken into account - if only because The side effect of this arrangement is that any custom template tags out there are relying on the fact that variable resolution *doesn't* happen in the render phase - at least, not in any automated or semi-automated way.So - at a high level API level, what you are suggesting sounds interesting - *args and **kwargs are a powerful mechanism in python, and I can see how they might be useful in the context of template tags as a general feature - but I'm not sure I see how this would manifest in practice. The only two approaches I can see are:1) a backwards incompatible change at the root level of template tag design, or2) a manual change to each of Django's internal template tags - which would represent a lot of code churn to satisfy a use case that isn't entirely clear.Are you able to clarify how you would see this change happening in practice?Yours,Russ Magee %-)