[Zope-CMF] image attribute

Dieter Maurer dieter@handshake.de
Tue, 8 Jul 2003 20:22:55 +0200


Glenn Pierce wrote at 2003-7-8 15:32 +0100:
 > Basically I have a product that is based on CMFDefault.NewsItem and I am
 > trying to store an OFS.Image that will be uploaded from a form into an
 > attribute of this product.
 > 
 > Could some one please show me a simple example of a method to store the
 > uploaded image ?

As far as I know, "CMFDefault.NewsItem" is not prepared to
get an image attribute.

You are right when you assume that this does not mean you cannot do it,
but it would be clearer to make your own content type derived
from "NewsItem".

I would use a ZClass for this, derived from "ObjectManager"
with a "NewsItem" and "Images" as content.
You may find some details in the "Web site construction kid" (or similar)
book. The essential chapter 5 is on "cmf.zope.org".

There are people that are very suspicious wrt ZClasses and
prefer Python based content classes.


Dieter