@staticmethod verses multiple #extends inheritance
"Dirk van Oosterbosch, IR labs" <[email protected]> Tue, 10 Nov 2009 18:25:57 +0100
| Newsgroups | gmane.comp.python.cheetah |
|---|---|
| Message-ID | <[email protected]> |
Hi,
I've been using Cheetah for a few years, but I've haven't been
following the list or the developments closely.
And I remember that multiple inheritance wasn't possible with previous
versions of Cheetah.
Now I'm reading that since v2.2.2 multiple inheritance is possible.
Great! :-)
I read about the #@staticmethod decorator, and this recipe http://packages.python.org/Cheetah/recipes/staticmethod.html
What would be better to use if I would like to mix #def's of different
template clases?
What's the difference between
#from foo import foo
and
#extends myclass, foo
?
Currently I'm using an Cheetah / pure python inheritance hierarchy to
use different framework functionality and libraries throughout my
different pages. Something like:
BaseSkeleton.tmpl
-> ExtraComponents.tmpl
-> PythonFramework.py
-> page.tmpl
-> typeA.tmpl
-> typeB.tmpl
-> typeC.tmpl
-> subtypeC2.tmpl
Now I would like to use #def methods from typeA.tmpl in subtypeC2.tmpl.
And maybe also the other way around: use #def methods from
subtypeC2.tmpl in typeA.tmpl
Would I be using the now possible multiple inheritance? Or the
#@staticmethod decorator?
best regards
And thanks for keeping Cheetah alive and kicking!
dirk
--
-----------------------------
Dirk van Oosterbosch
de Wittenstraat 225
1052 AT Amsterdam
the Netherlands
http://labs.ixopusada.com
-----------------------------
--
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july