[Zope] NameError when script called from product

Bakhtiar A Hamid kedai@kedai.com.my
Thu, 17 Apr 2003 17:19:22 +0800


On Thursday 17 April 2003 04:13 pm, Ken wrote:
> Hi all,
>
sorry to hear that you still don't have the answer.

> The product I am using (KebasData) has a property called render_method,
> which is the name of a dtml method that gets called from within the
> index_html of an instance, like so:
>
> <dtml-var "_[render_method]">
>

the best way to call from another method/script isto call the view() method, 
like so

<dtml-var "kebasdatainstance.view()">

i've added a __call__ method to KebasData (that's still not released yet) that 
will make the call like so:
<dtml-var kebasdatainstance>

i haven't released it because i;m not too sure it works well enough.
 

> My render method is called viewResults and it calls a script (Python)
> called PageListOutput, which is described in the ZopeLabs recipe found at
> http://www.zopelabs.com/cookbook/1019946889.
>
> Normally it is possible to display the rendered KebasData like so:
>
> http://mysite.org/kebasdata_instance
>
> which has always worked for me but not this time.
> What is strange, is that it works fine when called like so:
>
> http://mysite.org/kebasdata_instance/viewResults
>
> which, to my feeble understanding, should be no different..

it'd be best if you could provide me some data so that i can troubleshoot
an export of said objects would be best.

sorry i can;t help much

>
> The traceback:
>
> File /usr/sites/www/zope/lib/python/DocumentTemplate/DT_Util.py, line 159,
> in eval (Object: PageListOutput('.',page,step,_.len(match)))
>     (Info: _)
>   File &lt;string&gt;, line 2, in f
> NameError: (see above)
>
> Can anyone tell me what is missing?
>
> Details: Zope 2.5.1, Python 2.1.3 (binary), FreeBSD4.3
>
> Thanks,
>
> Ken
>
>
>
> _______________________________________________
> 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 )