[Zope-CMF] context.edit in content portal_skins

Jim Pharis jpharis@rtl.org
16 Jul 2002 13:14:23 -0400


I spent most of last week trying the new product approach. I was
semi-successful and realized I was far from done. I figured out that I
can use folder_edit_form, save it as project_edit_form in custom. I
added another input and called it description. When it saves in
description it now looks like this when I try to read it.

['my added stuff', 'description']

So I edited index_html to display properly by accessing the index of the
list.

     <blockquote tal:condition="exists: item/description"
                 tal:define="des0 python:item.description[0]" 
                 tal:content="des0" >
     </blockquote>
     <blockquote tal:condition="exists: item/description"
                 tal:define="des1 python:item.description[1]"
                 tal:content="des1">

Thanks for your help. Sometimes I ask questions and 2 hours later
realize better workarounds. 

On Tue, 2002-07-16 at 11:51, Carl Rendell wrote:
> Jim,
> 
> Not sure how to say this... It does not work quite like that.
> 
> The context.edit() you are referring to is the method within the 
> PortalFolder product which changes attributes of an existing folder.
> 
> You'll find all of the products within the CMF directories you 
> imported to install CMF [CMFCore, CMFDefault, etc] in this case 
> you're looking for PortalFolder in the CMFCore directory.
> 
> The attributes which are allowed to be passed to the _edit_ method 
> are defined by the product, and cannot be changed merely by adding 
> another key/value pair into the call.
> 
> You have a number of choices if you wish to _extend_ the base 
> PortalFolder product.
> 
>   - ZClass with PortalFolder as the base class
> 
>   - New product using PortalFolder as the base class, and additional
>     _properties_ [the method I prefer]
> 
>   - New product with its own classes defined
> 
> There are others of course, but this is the basic path you'll need 
> to follow. The information for creating ZClasses and Products is 
> all within the community of Zope sites.
> 
> ~C
> 
> On Tuesday, July 16, 2002, at 03:24  AM, zope-cmf-request@zope.org 
> wrote:
> 
> > Message: 2
> > From: Jim Pharis <jpharis@rtl.org>
> > Cc: Zope-CMF@zope.org
> > Date: 15 Jul 2002 12:40:50 -0400
> > Subject: [Zope-CMF] context.edit in content portal_skins
> >
> > CMF'ers
> >
> > In CMF->portal_skins->content there is a Python script called
> > folder_edit which takes 2 parameters. Whats context.edit, where is 
> > it? I
> > can't find it anywhere.
> >
> > I am adding an extra input field to contain some additional info. I am
> > assuming that I need to send the 3rd parameter to context.edit the same
> > way I send the first 2 parameters. This is my change.
> >
> > Parameter List: title, description, creator, choice=' Change '
> >
> > context.edit( title=title,
> >               description=description,
> >               creator=creator)
> >
> > Of course gives me an error when I add creator.
> >
> > Hopefully this is an easy question and somebody can just point to where
> > context.edit is. Maybe its not though.
> >
> > Thanks in advance, Jim
> 
> Carl E. Rendell
> Solution43
> Information Distribution Consulting        |   "Ahhhh the power of
> cer@sol43.com                              |    acquisition"  - Chef Z