Error with context.absolute_url() in Python script
Hi all : ) I am hacking away at a CMF content type. This content type has an edit() method. There is a page template in a skins folder called mycontenttype_edit_form. The form in this PT submits to a Python script called mycontenttype_edit, which is also in the same skins folder. In this Python script, the edit() method is called through context.edit(), and then the user is redirected using a context.REQUEST.RESPONSE.redirect() call. In order to get the right address to redirect them to, I call context.absolute_url() and add some stuff to the end of the string. I am getting an error on context.absolute_url(). The traceback shows that the context is an instance of my content type. The context.edit() call is working fine. The error I am getting on absolute_url() is shown in this last bit of the traceback: line 115, in _exec (Object: question_edit) (Info: ({'script': <FSPythonScript instance at 8780e90>, 'context': <MyContentType instance at 8d286c8>, 'container': <CMFSite instance at 8a1f398>, 'traverse_subpath': []}, (), {}, None)) File Script (Python), line 13, in mycontenttype_edit File /usr/local/zope/2.5.0_base/lib/python/OFS/Traversable.py, line 37, in absolute_url (Object: contenttype_instance) File /usr/local/zope/2.5.0_base/lib/python/OFS/Traversable.py, line 60, in getPhysicalPath (Object: contenttype_instance File /usr/local/zope/2.5.0_base/lib/python/OFS/SimpleItem.py, line 65, in getId (Object: contenttype_instance) TypeError: id() takes exactly 1 argument (0 given) Does anyone have any ideas where I'm going wrong? Thanks in advance :) Harry
Harry Wilkinson writes:
I am hacking away at a CMF content type. ... Traceback: ... getPhysicalPath (Object: contenttype_instance File /usr/local/zope/2.5.0_base/lib/python/OFS/SimpleItem.py, line 65, in getId (Object: contenttype_instance) TypeError: id() takes exactly 1 argument (0 given) Apparently, something is wrong with its "id" or "getId".
Dieter
participants (2)
-
Dieter Maurer -
Harry Wilkinson