Re: Problem with DRY and feeding parent's template block

2006-06-22 Thread Malcolm Tredinnick
On Thu, 2006-06-22 at 11:52 +0100, Frankie Robertson wrote: > On 22/06/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > > > On Thu, 2006-06-22 at 10:01 +, Jaroslaw Zabiello wrote: > > > Django uses Python modules instead of classes. The problem is how to > > > avoid duplication of the cod

Re: Problem with DRY and feeding parent's template block

2006-06-22 Thread Matt McDonald
You can also make use of Inclusion Tags. Very easy to use: http://www.djangoproject.com/documentation/templates_python/ #inclusion-tags I use them for all dynamic sections that appear across templates. On 22/06/2006, at 8:32 PM, Malcolm Tredinnick wrote: > > On Thu, 2006-06-22 at 10:01 +,

Re: Problem with DRY and feeding parent's template block

2006-06-22 Thread Frankie Robertson
On 22/06/06, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > On Thu, 2006-06-22 at 10:01 +, Jaroslaw Zabiello wrote: > > Django uses Python modules instead of classes. The problem is how to > > avoid duplication of the code in controllers when I want to put some > > data to parent templates?

Re: Problem with DRY and feeding parent's template block

2006-06-22 Thread Malcolm Tredinnick
On Thu, 2006-06-22 at 10:01 +, Jaroslaw Zabiello wrote: > Django uses Python modules instead of classes. The problem is how to > avoid duplication of the code in controllers when I want to put some > data to parent templates? Let see the example: > > base.html: > {% block welcome %} > Hello {

Problem with DRY and feeding parent's template block

2006-06-22 Thread Jaroslaw Zabiello
Django uses Python modules instead of classes. The problem is how to avoid duplication of the code in controllers when I want to put some data to parent templates? Let see the example: base.html: {% block welcome %} Hello {{ name }}! {% endblock %} {% block main %}{% endblock %} test1.html: {% e