[Zope] Overriding Z Class methods in instances

Dieter Maurer dieter@handshake.de
Thu, 31 Aug 2000 21:24:50 +0200 (CEST)


Johann Visagie writes:
 > It seems you cannot overload the methods of a Z Class in an instance of that
 > class.  If you try to, you get a message that the method's id is invalid
 > since it is already in use.
 > 
 > If this is really the case, then how can one achieve the necessary separation
 > between presentation and business logic?  E.g. if I have a Z Class with an
 > index_html method, all instances of that Z Class will display in exactly the
 > same way.
It is, at least now.

On zope-dev, it was discussed how this
restriction can be removed in the future in a controlled way
(you do not want to make everything overwritable).

To avoid the problem, you can add in your class method something
like:

	<dtml-if index_html_specialized>
	  <dmtl-var index_html_specialized>
	<dtml-else>
	  ....
	</dtml-if>

and define "index_html_specialized" in your instance, whenever
you would like to have specialized behaviour.



Dieter