[Zope] Re: adding images (was: Help)

Dieter Maurer dieter@handshake.de
Fri, 2 Nov 2001 22:13:56 +0100


Scott Kuei writes:
 > I have one more question.
Your message still does not go to the list....

And usually, I do not read HTML messages. You are lucky this time (only).

 > I'm sorry to bother you. As you mentioned in the last
 > letter, the manage_addImage function can work the same as addImage function? But we
 > just have to add the meta data? If I want to make something like a image uploading
 > page where people can upload their images and annotate their images. For example,
 > people can put in a description and date of the image produced. Stuff like that, do
 > you think manage_addImage is a solution for doing that kind of stuff? Thanks.
I gave also some hint how to do it...

Several options:

  *  make a ZClass inheriting from "Image", give it a property sheet with
     your additional meta data
     make a constructor form that lets your user specify all data
     (especially the image)
     make a constructor action that creates an instance
     of your ZClass, adds the meta data and the image (with "manage_upload")

     The Zope Book should tell you more about ZClasses.

  *  make your own add (and edit) form and action.
     The add form lets the user specify all meta data and the image.
     The action creates a new image (with manage_addImage),
     adds the required properties (with "manage_addProperty")
     and then gives them the required values (with "manage_editProperties").

  *  make a Python based product inheriting OFS.Image.
     Give it additional properties. Make add form and action
     similar to previous option (but you do not need to
     add the properties as they are already there).

The second approach is the easiest, but also the one that is the
most difficult to maintain (in case you should want to add an
additional property, for example).
The other approaches are similar. ZClasses support you via
a Web based interface. This is missing for Python based products
(you need to read the Developper Guide...). Python based products
are more efficient, but some people think there are easier
to maintain (I do not belong to this group).


Next time:
  To the list!
  Plain Text!


Dieter