Can't access my zope product functions by URL
I have made my first attempts on developing my own products in Python and I have a problem I can't find any solution to. My problem is that I can't access functions in my product by the URL. I have tried to find what's wrong for several days now, but I can't really find anything. I have used the boring-product example product as base for my tries and my initialization is pretty much the same. My "__init__.py" file registers a class called RSSFeed and just as the boring-product it currently only contains functions to add the object to the Zope object-DB, view the object and change the title. When the user changes the title it uses a form that calls the function manage_edit(). The problem is that when I do that I get a 404 error telling that the file "http://www.myserver.org/test/myobject/manage_edit" doesn't exist. What makes my hair fading to gray is that my code for this is almost identical to the boring-product example and there it works! One major difference is that I call the "security.declareProtected()" function to register my function and boring-product uses an "__ac_permissions__" list instead. But I declare my function access rights just as all other products I've looked at. Also other functions I make in my product and declares the same way gives the 404 error. One interesting thing is that I can call them from inside my index.dtml file for the product, by doing <dtml-var function>-calls. I guess I have missed something with the security settings, but I can't find what it is. Please help me if you can, I am getting insane trying to find it myself. You can see the code for my RSSFeed class attached to this mail. My Zope version is 2.7.4. -- -------------------------------------------------------------------------- Anders Karlsson Email: anders.karlsson@cendio.se Cendio AB WWW: www.cendio.se Teknikringen 3, Voice: +46 - (0)13 - 21 46 00 SE-583 30 LINKÖPING, SWEDEN Fax: +46 - (0)13 - 21 47 00
On Wed, Feb 23, 2005 at 04:32:24PM +0100, Anders Karlsson wrote:
When the user changes the title it uses a form that calls the function manage_edit(). The problem is that when I do that I get a 404 error telling that the file "http://www.myserver.org/test/myobject/manage_edit" doesn't exist. What makes my hair fading to gray is that my code for this is almost identical to the boring-product example and there it works! One major difference is that I call the "security.declareProtected()" function to register my function and boring-product uses an "__ac_permissions__" list instead. But I declare my function access rights just as all other products I've looked at.
This one comes up occasionally... Your manage_edit() lacks a docstring. ZPublisher refuses to publish methods that do not have docstrings. There should be a note to that effect in the error message, if you look at it more closely. -- Paul Winkler http://www.slinkp.com
On Wednesday 23 February 2005 18.30, Paul Winkler wrote:
This one comes up occasionally... Your manage_edit() lacks a docstring. ZPublisher refuses to publish methods that do not have docstrings.
There should be a note to that effect in the error message, if you look at it more closely.
Thanks a lot! That solved it! I didn't think the docstrings would make any diference. Regards, -------------------------------------------------------------------------- Anders Karlsson Email: anders.karlsson@cendio.se Cendio AB WWW: www.cendio.se Teknikringen 3, Voice: +46 - (0)13 - 21 46 00 SE-583 30 LINKÖPING, SWEDEN Fax: +46 - (0)13 - 21 47 00
On Wed, Feb 23, 2005 at 09:03:26PM +0100, Anders Karlsson wrote:
On Wednesday 23 February 2005 18.30, Paul Winkler wrote:
This one comes up occasionally... Your manage_edit() lacks a docstring. ZPublisher refuses to publish methods that do not have docstrings.
There should be a note to that effect in the error message, if you look at it more closely.
Thanks a lot! That solved it! I didn't think the docstrings would make any diference.
It is kinda non-intuitive... it's what has become known as a "dead chicken" in z3 land. -- Paul Winkler http://www.slinkp.com
participants (2)
-
Anders Karlsson -
Paul Winkler