[Zope] Zope factory uses the file name not the instance method

Max M maxm at mxm.dk
Fri Oct 10 19:44:46 EDT 2003


Dieter Maurer wrote:
> Max M wrote at 2003-10-9 18:04 +0200:
>  > ...
>  > The zmi version worked nicely. The product gets added etc. But the edit 
>  > version, which is for the custom editing interface, did NOT work when I 
>  > called it from a form:
> 
> What does "did NOT work" mean?

I get a 404. Zope cannot find the PageTemplate. Normally I don't have 
this problem, as I usually call the file the same name as the callable 
instance. Like:

manage_addSomeForm = PageTemplateFile('zpt/manage_addSomeForm', globals())

Bu in this case where the filename and the instance are different I get 
the problem.

>  > <input type="submit"
>  > name="/manage_addProduct/ots_Forum/manage_addTopic:method"
>  > class="button" tal:attributes="value i18n/new">
> 
> The leading "/" before "manage_addProduct" is strange.
> You are sure that the object should be created in the Root Folder?

No, and it doesn't. The rest of the url is in the action part of the form.

Besides I have tried it both with and without the leading '/'. It 
doesn't matter.

I don't believe that Zope uses urlparse.urljoin() when adding the action 
and a method button in a form. So the leading '/' doesn't get parsed as 
the root of the site.

Also it reports the url i expect when I get the 404.

regards Max M




More information about the Zope mailing list