[Zope] Re: StructuredDocument editing via web form

Maik Jablonski maik.jablonski at uni-bielefeld.de
Wed Mar 24 01:21:57 EST 2004


John Schinnerer wrote:

> Hello,
> 
> I am hoping to use Maik Jablonski's StructuredDocument product to allow
> a client to edit structured text content portions of pages of their web
> site.
> I want my client to be able to use a simple web form to edit their
> content, and keep them out of the ZMI.
> 
> I call a simple zpt web form on the StructuredDocument I want to edit.
> Current content of the StructuredDocument is displayed in an editable
> textarea and I can make whatever changes I want.
> 
> What I am stuck on is getting the submission of the form to update the
> content of the StructuredDocument it is called on.
> 
> I have just tried to do this with a Python script, the key line being:
> 
> context.content = request.stx_content
> 
> ...where stx_content is the name of the editable textarea in the form.

You can't assign values directly to attributes in PythonScripts. You need to
go with the API. StructuredDocument implements the DTMLMethod/Document-API,
so you can use:

context.manage_edit(request.stx_content, context.title)

Cheers, Maik




More information about the Zope mailing list