Re: Nested blocks in base template.
On 27 avr. 2013, at 11:05, Jonathan Slenders wrote: > Is this documented? If so, then I need to fix it. Maybe I'm biaised :) but that's the result I would expect. What would you expect? -- Aymeric. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at http://groups.google.com/group/django-developers?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Nested blocks in base template.
Seems reasonable to me, the tool should try it's best to preserve the behaviour as much as possible, wheter it's documented or not. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at http://groups.google.com/group/django-developers?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Nested blocks in base template.
It looks like the only place I can find where {{ block.super }} is documented[1] doesn't include explicitly explain how the super block is executed, but it is certainly the reasonable thing to do: execute the super block in the current template's context as if it hadn't been overridden. Otherwise overriding both {{ block one }} and {{ block base }} would be impossible. [1]: https://docs.djangoproject.com/en/1.5/topics/templates/#template-inheritance On Sat, Apr 27, 2013 at 5:05 AM, Jonathan Slenders < jonathan.slend...@gmail.com> wrote: > Hi all, > > Somebody reported a bug for django-template-preprocessor. I'm wondering > whether this is documented behaviour for the Django template language, or > whether this is just something that happens to be this way because of the > implementation. > > https://github.com/citylive/django-template-preprocessor/issues/24 > > > in base: > > some html here{% block base %}{% block one %}block > one{% endblock %}{% endblock %} > > > In inherited: > > {% extends "template_base.html" %}a little bit more html here{% block > base %}{{ block.super }}and more html{% > endblock %}{% block one %}overriden block{% endblock %} > > > The result of Django: > > some html hereoverriden blockand more html > > > > Is this documented? If so, then I need to fix it. > (btw, django-template-preprocessor deserves an update as well. It's still > working nice, but hasn't seen that much progress last year.) > > > Thanks, > Jonathan > > -- > You received this message because you are subscribed to the Google Groups > "Django developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-developers+unsubscr...@googlegroups.com. > To post to this group, send email to django-developers@googlegroups.com. > Visit this group at http://groups.google.com/group/django-developers?hl=en > . > For more options, visit https://groups.google.com/groups/opt_out. > > > -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at http://groups.google.com/group/django-developers?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Nested blocks in base template.
Hi all, Somebody reported a bug for django-template-preprocessor. I'm wondering whether this is documented behaviour for the Django template language, or whether this is just something that happens to be this way because of the implementation. https://github.com/citylive/django-template-preprocessor/issues/24 in base: some html here{% block base %}{% block one %}block one{% endblock %}{% endblock %} In inherited: {% extends "template_base.html" %}a little bit more html here{% block base %}{{ block.super }}and more html{% endblock %}{% block one %}overriden block{% endblock %} The result of Django: some html hereoverriden blockand more html Is this documented? If so, then I need to fix it. (btw, django-template-preprocessor deserves an update as well. It's still working nice, but hasn't seen that much progress last year.) Thanks, Jonathan -- You received this message because you are subscribed to the Google Groups "Django developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To post to this group, send email to django-developers@googlegroups.com. Visit this group at http://groups.google.com/group/django-developers?hl=en. For more options, visit https://groups.google.com/groups/opt_out.