[Zope] ZSQL methods in parent subfolder

John Eikenberry jae@kavi.com
Tue, 9 Mar 1999 16:56:07 -0800 (PST)


Is this behaviour a bug?

I have all my ZSQL methods collected together in a folder. If I call these
from a sibling folder[1] without any arguments, ie.

<!--#in "sql.company"-->

I get the below error, if I call them with specific arguments, ie.

<!--#in "sql.company(comp_id=_['comp_id'])"-->

I get no errors. (comp_id was in REQUEST in both cases).

[1] by sibling folder I mean something like the following arrangement...

/sql/company  		(where the sql method is stored)
/lists/company_list 	(where the call is made)

Here's the error:

<!--
 Error type:  
 Error value: 0
 -->

Traceback (innermost last):
  File lib/python/ZPublisher/Publish.py, line 877, in publish_module
  File lib/python/ZPublisher/Publish.py, line 590, in publish
    (Info: /filter/contacts/index_html)
  File lib/python/OFS/DTMLDocument.py, line 212, in __call__
    (Object: index_html)
  File lib/python/OFS/DTMLDocument.py, line 208, in __call__
    (Object: index_html)
  File lib/python/DocumentTemplate/DT_String.py, line 513, in __call__
    (Object: index_html)
  File lib/python/DocumentTemplate/DT_In.py, line 656, in renderwob
    (Object: sql.companies)
  File lib/python/Shared/DC/ZRDB/DA.py, line 420, in __getitem__
    (Object: CopySource)
  File lib/python/Shared/DC/ZRDB/Aqueduct.py, line 332, in __getitem__
KeyError: (see above)


Looking into it, line 332 in Aqueduct.py is a simple key lookup...

    def __getitem__(self, key): return self._data[key]

It would seem that an argument is getting passed in by default when the
sql in put in a parent's subfolder.

---

John Eikenberry
[jae@kavi.com - http://taos.kavi.com/~jae/] 
______________________________________________________________
"A society that will trade a little liberty for a little order
 will deserve neither and lose both."
                                         --B. Franklin