NameError when rendering a zsql-method in a dtml-method in a dtml-method
maybe this is a simple problem, but not to me as a beginner... when rendering a dtml-method which renders itself a dtml-method which calls zsql-method i get the following: ErrorError Type: NameError Error Value: There is no variable named 'name_of_zsql_method' simple namespace problem? playing around with "dtml-with" did not help. please help me. thanks in advance. Andreas Hölzl
You need to tell us the name of the zsql method, and show how you asked for it to be rendered. Surely you didn't really ask for "name_of_zsql_method" literally, did you? Tom P [Andreas Hölzl] maybe this is a simple problem, but not to me as a beginner... when rendering a dtml-method which renders itself a dtml-method which calls zsql-method i get the following: ErrorError Type: NameError Error Value: There is no variable named 'name_of_zsql_method' simple namespace problem? playing around with "dtml-with" did not help.
-------------------
You need to tell us the name of the zsql method, and show how you asked for it to be rendered.
Surely you didn't really ask for "name_of_zsql_method" literally, did you?
Tom P
ok, this is it in detail: first of all i try to render a dtml-method "base_method" located in "/root/subfolder/subsubfolder" via URL. "base_method" is a layout template. inside "base_method" i call the dtml-method "db_query" located in "/root/subfolder/db_stuff" (!) for the output of a more complex db-query : ... <dtml-with db_stuff> <dtml-var "db_query(...)"> </dtml-with> ... Zope finds "db_query" in "db_stuff" and renders it, but is not able to call zsql-methods also located in the same directory "/root/subfolder/db_stuff". Inside "db_query" i try: ... <dtml-in "specific_zsql_method(...)"> ... </dtml-in> ... i tried to fix it with "dtml-with", but when i put "<dtml-with db_stuff>" around the in-tag, Zope can't find "db_stuff". so i'm quite a bit confused. thanks for an answer. Andreas Hölzl
Andreas =?iso-8859-1?q?H=F6lzl?= writes:
when rendering a dtml-method which renders itself a dtml-method which calls zsql-method i get the following:
ErrorError Type: NameError Error Value: There is no variable named 'name_of_zsql_method' Almost surely, you have broken the DTML namespace chain:
If you call DTML objects explicitly (i.e. in an expr="..."), then you (usually) must pass two positional parameters: "_.None" and "_". More information URL:http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html Dieter
participants (3)
-
Andreas Hölzl -
Dieter Maurer -
Thomas B. Passin