Call python functhion in dtml-file
I have problem with below code: ------A.py------ def aaa(self): " " # do something class A: manage_AAAForm2=DTMLFile('dtml\manage_AAAForm2',globals()) def aa(self, sub): " " if sub=='edit': return self.manage_AAAForm2(self,self.REQUEST) -----file A.dtml---- <form name="form" action="aaa"> <input type="text" name="Name" value=<dtml-var Name>> <input type="submit" name=sub value="edit"> </form> Zope write: Site Error An error was encountered while publishing this resource. Debugging Notice Zope has encountered a problem publishing your object. Cannot locate object at: http://localhost:8080/min/1/aaa Zope cannot find function aaa() from A.py. How can I call python functhion in dtml-file? Regard, Serg
It depends on how you have defined the aaa method. External or Python product? Serg wrote:
I have problem with below code: ------A.py------ def aaa(self): " " # do something class A: manage_AAAForm2=DTMLFile('dtml\manage_AAAForm2',globals()) def aa(self, sub): " " if sub=='edit': return self.manage_AAAForm2(self,self.REQUEST)
-----file A.dtml---- <form name="form" action="aaa"> <input type="text" name="Name" value=<dtml-var Name>> <input type="submit" name=sub value="edit"> </form>
Zope write: Site Error An error was encountered while publishing this resource. Debugging Notice Zope has encountered a problem publishing your object. Cannot locate object at: http://localhost:8080/min/1/aaa
Zope cannot find function aaa() from A.py.
How can I call python functhion in dtml-file?
Regard, Serg
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
.
-- Peter Bengtsson, http://www.peterbe.com
Serg wrote:
I have problem with below code: ------A.py------ def aaa(self): " " # do something
How is Zope supposed to find this aaa method? Where does it become an attribute of your class or your object?
Zope write: Site Error An error was encountered while publishing this resource. Debugging Notice Zope has encountered a problem publishing your object. Cannot locate object at: http://localhost:8080/min/1/aaa
Exception type, value and traceback please...
Zope cannot find function aaa() from A.py.
How can I call python functhion in dtml-file?
Make it a method of your A class.... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
participants (3)
-
Chris Withers -
Peter Bengtsson -
Serg