[Zope3-Users] Add and Edit form
Cliff Ford
Cliff.Ford at ed.ac.uk
Fri May 12 17:06:36 EDT 2006
Hi John,
John Smith wrote:
> I am a little unclear into which object I should add the nextURL
> method.
>
> In myclass/browser/configure.zcml I have addMenuItem and addForm
> directives. I have tried adding the nextURL method to the class
> specified in the 'class' parameter of the addForm directive. That
> does not work.
That is where mine is. Here is the addform configuration:
<browser:addform
label="Add Folder with Index page"
name="addmontifolder.html"
schema="zope.app.folder.interfaces.IFolder"
permission="zope.ManageContent"
template="addmontifolder.pt"
class=".addmontifolder.MontiFolder"
content_factory="zope.app.folder.folder.Folder"
/>
And this is a fragment of the addmontifolder.py file:
class MontiFolder(ViewPage):
"""This class reads the form data and creates a new folder with index
page and menu. The created folder is actually a standard folder and the
created page is a standard page template.
"""
# nextURL is used to determine where to go after making a new object
def nextURL(self):
Look at your traceback to find out why it does not work.
Cliff
> Stephan replied that the zope.app.form classes is where to override
> the nextURL method, but where do I fit a zope.app.form instance into
> my configuration?
>
> Thanks,
>
> John
>
> Cliff Ford <Cliff.Ford at ed.ac.uk> wrote: This is an example mextURL
> function that I used to add a folder containing a page, and then go
> to the folder. Going to the page is just an addition to the last
> line.
>
> HTH
>
> Cliff
>
> def nextURL(self):
>
> """ This function is called for redirection after folder creation. We
> can use it to fill out metadata collected from a custom add form. """
>
>
>
> --------------------------------- Yahoo! Cars NEW - sell your car
> and browse thousands of new and used cars online search now
> ---------------------------------
>
>
>
> ------------------------------------------------------------------------
>
>
> _______________________________________________ Zope3-users mailing
> list Zope3-users at zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users
More information about the Zope3-users
mailing list