[Zope] Adding default methods to a folderish ZClass

Tres Seaver tseaver@palladion.com
Tue, 28 Mar 2000 08:13:02 -0600


(Sorry for omitting to re-title the previous posts!)

John Morton wrote:
> 
> John Morton writes:
>  > John Morton writes:
>  >  > So I've got something working, using the various object add methods,
>  >  > but I need to make sure I have one for each type of object in my
>  >  > default set, and I have a feeling that I'll need to recurse into
>  >  > folders to add those and their contents.
>  >
>  > Arg! I don't seem to be able to add anything other than DTML methods
>  > and properties inside a Zclass creation. So it looks like I'm back to
>  > doing it all by had. What a time saver...
> 
> Take three. I've solved the problem for all cases by having the ZClass
> add method redirect to a method that copies the default methods into
> the new ZClass instance, then redirects back to the management screen.
> 
> Might have to write a howto for this one.
> 
> John.

I'm glad you found a workaround.  Just offhand, did you try to just call that
additional method, before redirecting to it?  I have seen a couple of cases
where I refactored code like that into a new method and then things got simpler.

Tres.
-- 
=========================================================
Tres Seaver  tseaver@digicool.com   tseaver@palladion.com