Re: [Zope] Fetching data from external methods
Jarkko Veijalainen wrote: > My method outputs are: > > res = (contains search result using forms input values) > sn = res.sn (one of the values in res-object) > return sn ^ that should be 'return res' ...then the following will work: > > > > this works > ...because that displays sn, which is what you're returning! > 1) how i can input values in LDAPsearch(how i input here) Don't understand what you want here... > 2) i don't have any control of return value, it returns list like > this > ('Ukko', '66', 'oEmail') you should be able to over whatever is returning that... Chris ___ Zope maillist - [EMAIL PROTECTED] 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 )
RE: [Zope] Fetching data from external methods
FINALY, your code sould look like: In externalMethod: return res #ENTIRE obj DTML code: yeah, thanks a lot, it works, but i have still a liitle problem this might sound like newbie question ( but i don't really know) how i can with input values like this myinput is data that i can type like search criteria in my search-form should i make somekind on handler-DTML? which picks up submitted datafrom my submitted form and puts them in ? PM jarkkov ___ Zope maillist - [EMAIL PROTECTED] 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 )
RE: [Zope] Fetching data from external methods
sorry but your example did'nt work: >in external method: > > return (obj1, obj2,) > >in DTML: > > > > > here is my submit forms code to explain my case cn: objectclass: LDAPsearch is my external method (object in zope which points to .py module) My method outputs are: res = (contains search result using forms input values) sn = res.sn (one of the values in res-object) return sn and i try to embed in dtml like this Zope returns error: Error Type: InError Error Value: Strings are not allowed as input to the in tag. if i try to return res.__dict__ in external method zope returns this kind of error: Error Type: KeyError Error Value: 0 this works but it lefs me with two problems 1) how i can input values in LDAPsearch(how i input here) 2) i don't have any control of return value, it returns list like this ('Ukko', '66', 'oEmail') >If you are submitting to your external method from an HTML form, you >will need to return the HTML to be >def my_external_method(self,param1,param2): > ...do stuff... > string = '' > string = string + ...render your results here... > string = string + '' > return string this solution worked, but it's not what i really want to do. I don't want include return HTML-file in my python script, like in that example. ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] Fetching data from external methods
Jarkko Veijalainen wrote: > in fact only problem here is how i return values from external > method like obj.value1 , obj.value2 into zope and use them in > dtml or/and in Zclass instances. in external method: return (obj1, obj2,) in DTML: If you are submitting to your external method from an HTML form, you will need to return the HTML to be displayed: def my_external_method(self,param1,param2): ...do stuff... string = '' string = string + ...render your results here... string = string + '' return string HTH, Chris ___ Zope maillist - [EMAIL PROTECTED] 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 )