Re: [Zope] Overriding Z Class methods in instances

2000-08-31 Thread Dieter Maurer

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:


  

  


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



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 )




Re: [Zope] Overriding Z Class methods in instances

2000-08-31 Thread Johann Visagie

Chris Withers on 2000-08-31 (Thu) at 12:38:17 +0100:
> 
> This used to be a very irritating problem. It has been fixed in 2.2.0 or
> 2.2.1 but I don't know how to what extent. Shane Hathaway is the man to
> ask ;-)

Well, I experience the problem with 2.2.1 so if there is a way to do it, it
involves some magic I'm not aware of.  :-)

> PS: A guide to the new overriding interface and how to use it (including
> in ZClasses) would be cool :-)

Awaiting enlightenment,
-- Johann

___
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] Overriding Z Class methods in instances

2000-08-31 Thread Chris Withers

Johann Visagie wrote:
> 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.

This used to be a very irritating problem. It has been fixed in 2.2.0 or
2.2.1 but I don't know how to what extent. Shane Hathaway is the man to
ask ;-)

cheers,

Chris

PS: A guide to the new overriding interface and how to use it (including
in ZClasses) would be cool :-)

___
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] Overriding Z Class methods in instances

2000-08-31 Thread Johann Visagie

This must either be a stupid FAQ, or I'm missing something.

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.

-- Johann

___
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 )