[Zope3-dev] Re: edit view of a object unknown?
Garrett Smith
garrett at mojave-corp.com
Sat Mar 6 11:58:54 EST 2004
Roger ineichen wrote:
> Hello together,
>
> Is there a way to get the edit view of a object?
>
> I can't find the right method for calling a
> edit view. The views don't know for what they are
> and I don't know how somebody is registering the
> name of a edit view. Except the defaultView.
> Most the time they called edit.html, but not at all.
>
> Or do I have to give back the object and select the edit
> view in the ZMI?
There's no general facility for getting an edit view on any object --
you'll need to declare an editform using ZCML (at least that's the
easiest way). Here's a snippet from file's configure.zcml
(zope/app/file/browser/configure.zcml):
<browser:editform
name="edit.html"
schema="zope.app.file.interfaces.IFile"
label="Change a file"
usage="objectview"
permission="zope.ManageContent"
class=".file.FileTextEdit"
/>
I'm not sure what 'usage' is doing there -- you can probably omit that
in your declaraion (someone who's the wiser, please feel free to
elaborate on why a simple edit form declaration needs to burden itself
with usage="objectview" :-) ??
As the snippet illustrates, the configuration of an edit form is quite
explicit -- "edit.html" might be "general.html" for another object, etc.
-- Garrett
More information about the Zope3-dev
mailing list