On Tuesday, June 10, 2014 12:14:21 AM UTC+2, Russell Keith-Magee wrote: > > > 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, or > > 2) 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 %-) >
Hi Russ, I've added patch with proposed functionality, tests included: https://code.djangoproject.com/ticket/13956#comment:34 Now I'm working on documentation. Regards -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/ae204da2-12e4-44aa-888d-b7b3e23d0dd4%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
