Hi,
I guess you're right, but that's exactly Markus' point. This is
inconvenient -- it is exactly one of those tradeoffs Aymeric
mentioned, and seems not well balanced to me, as does not look good in
the template code and I don't suppose that every Django developers
knows about {{ block.super }}.
Introducing yet more syntax ({% block … if … %}) doesn't seem like a solution to me.
What is the technical reason for {% if … %}{% block %} not being
possible (or, not behaving as expected)? Enabling this syntax would
improve readability a lot and satisfy Markus' request as well
without introducing new syntax.
(Although from my uneducated guesses of how the blocks work, this might
be very hard and not worthy to implement.)
{% if … %}{% block … %} seems indeed the most natural way a user would try to achieve this behaviour. In fact, I remember my surprise a couple of years ago when I discovered it didn't work.
-- unai -- 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/20150131213552.GO6883%40def. For more options, visit https://groups.google.com/d/optout.
signature.asc
Description: Digital signature
