[Zope-CMF] image attribute
Glenn Pierce
glennpierce@connectfree.co.uk
10 Jul 2003 00:23:10 +0100
On Tue, 2003-07-08 at 19:22, Dieter Maurer wrote:
> 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.
>
>
I have taken the default content types and moved them into my own
product.
I did this as I do not want to depend on CMFDefault. I wanted to remain
in python for the distributing advantages and to get more experience in
that area. Not that I have anything against zclasses :)
I have begun extending this NewsItem to provide a picture with some
text, at this stage it is proof of concept.
If successful I was going to create a CompositeDocument Type which I
could inherit from.
Basically I am trying to implement the third suggestion in the following
mail
http://mail.zope.org/pipermail/zope-cmf/2002-March/011799.html
Thanks for the help.