[Zope-dev] some suggestion..

Christian Scholz cs@comlounge.net
Thu, 28 Sep 2000 20:13:08 +0200


Hi!

While trying to code some python Product I had the need for extending
manage_delObjects in some Folderlike object. I simply want to call the
the ObjectManager's version of it and then do my own stuff afterwards
(like deleting some other dependant objects).

Unfortunately when calling manage_delObjects() one cannot decide
if some error occured or everything went ok as in both cases
I get back some string (be it some html formatted error message or
the manage_main dialog).

So what about splitting these methods in two, e.g. one _delObjects()
and one manage_delObjects(). The first one would the the actual work
like testing for error conditions and deleting the objects and the
other one would be the one called by the management interface.
manage_delObjects() would then call _delObjects() and checks for
errors afterwards generating some error message or the next dialog.
The errors could then be passed via exceptions or similar methods
from _delObjects() to manage_delObjects().

This would make subclassing a lot easier and would be at least a
start in separating layout from logic.

Just an idea :)

cheers,
  Christian

PS: Maybe it would even make XMLRPC more usable as there I also get
back only html formatted error messages instead of something making
more sense for a script (like an error code or something).

-- 
COM.lounge                                          http://comlounge.net/
communication & design                                   cs@comlounge.net