Re: [Zope] ZClass/DTML Document transparency
On Tue, 21 Nov 2000, Dieter Maurer wrote: > Randall Kern writes: > > > > In the case of DTML Documents, the following works fine: > > > > > > > > In the case of ZClasses, I have to use something like this: > > > > > > > > > > > > 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 ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] ZClass/DTML Document transparency
Randall Kern writes: > > In the case of DTML Documents, the following works fine: > > > > In the case of ZClasses, I have to use something like this: > > > > > > 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 ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
[Zope] ZClass/DTML Document transparency
Hi all, I have a folder (foo) which contains a set of DTML Documents, and instances of a ZClass. From another DTML document, I enumerate the contents of this folder, using a DTML-IN tag: ... My problem is with ..., namely dealing with both DTML documents and ZClasses. In the case of DTML Documents, the following works fine: In the case of ZClasses, I have to use something like this: So I'm using this: But this is rather ugly, and it's the sort of thing one shouldn't have to do in an oo system. So, is there a better way? -Randy