[Zope] FTP defaults, overloading, or monkeypatching?

Terry Hancock hancock@anansispaceworks.com
Mon, 09 Sep 2002 09:28:53 -0700


Hi All,

I've implemented a replacement image object that I
would really like to be the default on my site. I've
thought of a few different approaches, and would like
to see if there's any wisdom out there on which might
be the easiest (or perhaps safest?) approach:

1 FTP defaults

Can I change what product class is used to load image
data when it is "put" from the FTP interface?  I'm not
sure how it decides this, but when I upload images
they always appear as plain Zope images.  This would
probably be the most convenient solution, even though
it won't do much about the ZMI upload (but I can use
permissions to make the custom image easier to find),
and, of course, it won't fix existing image instances
(but that's a temporary problem).

2 Overloading

Could I overload the product class with my product?
E.g., could I just change "meta_type" to image in my
product and have it clobber the plain Zope image?
Sounds scary, but maybe possible.

3 Monkeypatching

This would probably be the least convenient approach --
start with Image and overload all its methods.  However,
this is the only method I've actually seen in use.

Opinions?

Thanks!
Terry

-- 
------------------------------------------------------
Terry Hancock
hancock@anansispaceworks.com       
Anansi Spaceworks                 
http://www.anansispaceworks.com 
P.O. Box 60583                     
Pasadena, CA 91116-6583
------------------------------------------------------