[clug] dynamic inserts with django templates?

Brendan Jurd direvus at gmail.com
Sun Dec 19 19:34:21 MST 2010

On 16 December 2010 23:45, Paul Wayper <paulway at mabula.net> wrote:
> On 12/15/2010 07:38 PM, Brendan Jurd wrote:
>> I write my pages as classes that all inherit from an abstract Page
>> class.  The common context settings for the common nav elements are
>> done there.  The templates are a mix of inheritance and includes.
> Is that within Django?  Because it doesn't sound like the Django way.  Would
> you like to give a Programming SIG talk on it? :-)

The Page class isn't part of the django toolset, it's something I
wrote myself, but it's nothing fancy.  It's just a way to handle the
elements that are common amongst multiple views.  I take the maxim
Don't Repeat Yourself seriously, and I like to achieve that via class
inheritance.  There's nothing stopping you from writing a whole bunch
of functions and passing requests and contexts between them, if that's
your poison.

I doubt there's enough material there to fuel a SIG talk.  It would
probably take all of five minutes to fully demonstrate it.


More information about the linux mailing list