I am using a default header that populates links via a query that resides in the same directory and it worked fine. I have since moved the query to a "sql" folder" and I can't seem to get it working anymore. Here is an example of the working code: <dtml-in expr="page_links_query(page_path=PATH_INFO)"> <A HREF="&dtml-link_path;"><dtml-var menu_item><BR> This worked when the query and the menu were in the same folder. However, I have put the query into a different folder and I have changed the code to look like this: <dtml-in expr="control/sql/page_links_query(page_path=PATH_INFO)"> <A HREF="&dtml-link_path;"><dtml-var menu_item> Why doesn't this work? The error says: Error Type: NameError Error Value: global name 'sql' is not defined Any suggestions would be appreciated. Thanks! Aaron.
Hi Aaron, I suspect that because you are using the expr="" syntax when calling your SQL method that the "/"'s are construed as division operators.. That is, you're dividing control by sql by page_links_query() :) Remember, expr="" means "here is a little piece of Python code to run. Try (untested):
<dtml-in expr="control.sql.page_links_query(page_path=PATH_INFO)"> <A HREF="&dtml-link_path;"><dtml-var menu_item>
instead. Hope that helps, Eric.
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Rustad, Aaron Sent: Tuesday, August 21, 2001 9:15 AM To: 'zope@zope.org' Subject: [Zope] relative paths....
I am using a default header that populates links via a query that resides in the same directory and it worked fine. I have since moved the query to a "sql" folder" and I can't seem to get it working anymore. Here is an example of the working code:
<dtml-in expr="page_links_query(page_path=PATH_INFO)"> <A HREF="&dtml-link_path;"><dtml-var menu_item><BR> This worked when the query and the menu were in the same folder. However, I have put the query into a different folder and I have changed the code to look like this:
<dtml-in expr="control/sql/page_links_query(page_path=PATH_INFO)"> <A HREF="&dtml-link_path;"><dtml-var menu_item>
Why doesn't this work? The error says: Error Type: NameError Error Value: global name 'sql' is not defined
Any suggestions would be appreciated. Thanks! Aaron.
_______________________________________________ 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 )
Hi Aaron, Rustad, Aaron wrote:
<dtml-in expr="control/sql/page_links_query(page_path=PATH_INFO)"> <A HREF="&dtml-link_path;"><dtml-var menu_item>
when you use expr="..." you are in python, so what you said above was divide control by sql by results of function page_links_query <wink>. You should use the '.' instead <dtml-in expr="control.sql.page_links_query(....">
Why doesn't this work? The error says: Error Type: NameError Error Value: global name 'sql' is not defined
Any suggestions would be appreciated. Thanks! Aaron.
-- Tom Jenkins devIS - Development Infostructure http://www.devis.com
participants (3)
-
Eric Walstad -
Rustad, Aaron -
Tom Jenkins