Re: [Zope] ZClass/DTML Document transparency
Randall Kern writes:
.... In the case of DTML Documents, the following works fine:
<dtml-var sequence-item>
In the case of ZClasses, I have to use something like this:
<dtml-with sequence-item> <dtml-var index_html> </dtml-with> .... But this is rather ugly, and it's the sort of thing one shouldn't have = to do in an oo system. I understand you, but in all "oo" systems, you can avoid this only if both objects have the same method.
In Zope, DTML objects have a "__call__" method which is called automatically. ZInstances do not have a "__call__" method. What suggests to you, that these too should be unified is the fact, that ZPublisher does it. If an object has a "__call__", it is used; if not, "index_html" is called, if it exists. You may look at the mixin "ZCallable". I do not know what it does but the name suggests, it might perhaps help you. Dieter
On Tue, 21 Nov 2000, Dieter Maurer wrote:
Randall Kern writes:
.... In the case of DTML Documents, the following works fine:
<dtml-var sequence-item>
In the case of ZClasses, I have to use something like this:
<dtml-with sequence-item> <dtml-var index_html> </dtml-with> .... But this is rather ugly, and it's the sort of thing one shouldn't have = to do in an oo system.
You may look at the mixin "ZCallable". I do not know what it does but the name suggests, it might perhaps help you.
I could not make ZCallable work ("too many datafull baseclasses" even if it is the *only* baseclass). Maybe you could use the Renderable product, which lets you override the __str__ method. Stefan
participants (2)
-
Dieter Maurer -
Stefan H. Holek