[Zope-CMF] Easy Content-Add script

Jeffrey P Shell jeffrey@cuemedia.com
Mon, 12 Nov 2001 16:17:06 -0700


I had to do something similar on a recent project.  I wrote a Tool 
to assist me (I had some other policies about these objects that a 
separate tool would be good for).

The story was that the user needed to enter in one form to submit a 
Film for review, and from that form up to *three* objects needed to 
be created - the Film (whose ID was calculated from the films 
title), the Contact information (stored as a subobject of the 
film), and Comments (created as a Discussion/Reply object) if they 
filled any in.

Writing a Tool class ensured that I had some helpful utility 
methods and policies outside of the Film object itself, and gave me 
the full benefits of unrestricted Python.  It worked out really 
well.

And I designed the app so that the users never saw the 
'folder_contents' view, or the CMF "Add" page (after much arm 
wrestling with various action providers).

On Monday, November 12, 2001, at 12:56  PM, Jan Torben Heuer wrote:

> Am Montag, 12. November 2001 00:56 schrieb Florent Guillaume:
>
>> It's not clear from what you say if you want to set properties at 
>> object
>> creation time, or later on.
> At the objects creation time. I'll let user post a newsitem (hope 
> I'll be
> able to do this with each other Content Type  as well) within one 
> step, not
> divided into
> 1.) selecting ID
> 2.) puttin in metadata
> 3.) edditing body
>
> Just let the user edit some of theese types in one form. Finally a 
> preview
> would be fine. The workflow process can still be the same.
>
> As I said, the formular is no problem at all, you can expect the same
> fieldnames as used by the old style edit formulars.
>
> Hope that's clear?
>
> The problem I saw at Tres script was (expect for an error I 
> couldn't solve)
> that it was related to a context object, I guess it's the newsitem 
> itsself,
> however as I said there I no newsitem at that point *g*