I know I am still using PythonMethods however I have not seen Python Scripts out yet for 2.2.4. Okay here is the problem. How do I call one PythonMethod from another PythonMethod? Example object foo is a python method and it takes a='',b='',c='',d='' does stuff returns a string foo_spec takes parameters a1='',b1='' it should return foo(a=a1,b=b1) However trying to call that foo gives an error. I get a NameError on foo when it is used in foo_spec. However using foo directly does work however I want to make easier customized interfaces for users. Thanks
PythonScripts will come with Zope 2.3 How did you call the method? perhaps you forgot the 'self' your call should look like this: self.foo(...) phil *********** REPLY SEPARATOR *********** On 10.12.2000 at 16:22 kosh wrote:
I know I am still using PythonMethods however I have not seen Python Scripts out yet for 2.2.4.
Okay here is the problem. How do I call one PythonMethod from another PythonMethod?
Example
object foo is a python method and it takes a='',b='',c='',d=''
does stuff returns a string
foo_spec takes parameters a1='',b1='' it should return foo(a=a1,b=b1)
However trying to call that foo gives an error.
I get a NameError on foo when it is used in foo_spec. However using foo directly does work however I want to make easier customized interfaces for users.
Thanks
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
I was having a lot of problems with keeping a catalog up to date when I manipulated data in an instance of a zclass (catalog aware). I was calling this, from a dtml file in the same folder as the instances, and one folder down from the Catalog: <dtml-call "_[userid].propertysheets[1].manage_changeProperties(REQUEST)"> <dtml-call reindex_object> This just was not re-indexing the Catalog successfully at all. I checked the zope list and I think that a lot of people have had the same problem, including myself a few months back... All the answers suggest using: <dtml-call reindex_object> or even: <dtml-call reindex_object> <dtml-call reindex_object> So I just littered that all through my code in the vein hope that the Catalog would get the hint. But it was stubborn. The data would be altered, meanwhile the Catalog remained oblivious. The good news is that I have seemingly found a way to update my catalog by making a method of my zclass called update_dtml which I call when change the data of an instance. the method contains only one thing (of course): <dtml-call reindex_object> I call it from the dtml that manipulates the data of the instance (from a file in the same directory as the instances): <dtml-call "_[userid].propertysheets[1].manage_changeProperties(REQUEST)"> <dtml-in "objectValues(['zclassuser'])"> <dtml-var update_dtml></dtml-in> The bad news is that I don't have a clear understanding of why this works. I guess that the <dtml-call reindex_object> is context sensitive and is a method of the zclass, so it needs to be called from there. Does this make sense ? If it does I think that it should be turned into a how to. or am I just being silly? josh on =========================== write: josh@futurefarmers.com read: www.futurefarmers.com read: www.crd.rca.ac.co.uk/~josh interrupt (i love it): (415) 552 2124 =============================
participants (3)
-
josh on -
kosh -
Philipp Auersperg