[Zope] ZSQL methods in a ZClass

Tim Wilson wilson@visi.com
Fri, 17 May 2002 15:41:02 -0500


Hi everyone,

I'm building a little ZClass that I intend to use as a wrapper of sorts
around a bunch of ZSQL methods. The reason is that I want to give people
access to this SQL database, but I don't want to litter the root of my
Zope with bunches of ZSQL and DTML methods just so they can be acquired
in various other folders.

Putting DTML methods in as methods of the ZClass should work fine, but
the ZSQL methods don't seem to work. I get a traceback when I attempt
to view a DTML method that calls a ZSQL method. Am I trying something
that isn't possible? Here's the traceback. I'm open to suggestions:
(please forgive the ugly formatting of the traceback. I've recently
changed to mutt as my MUA and it's doing this now.)

Traceback (innermost last):
  File /home/wilson/zope/2.5.1b1/lib/python/ZPublisher/Publish.py, line
  150, in publish_module
    File /home/wilson/zope/2.5.1b1/lib/python/ZPublisher/Publish.py,
    line 114, in publish
      File /home/wilson/zope/2.5.1b1/lib/python/Zope/__init__.py, line
      159, in zpublisher_exception_hook
          (Object: EventConduit)
	    File
	    /home/wilson/zope/2.5.1b1/lib/python/ZPublisher/Publish.py,
	    line 98, in publish
	      File
	      /home/wilson/zope/2.5.1b1/lib/python/ZPublisher/mapply.py,
	      line 88, in mapply
	          (Object: rpt_locations)
		    File
		    /home/wilson/zope/2.5.1b1/lib/python/ZPublisher/Publish.py,
		    line 39, in call_object
		        (Object: rpt_locations)
			  File
			  /home/wilson/zope/2.5.1b1/lib/python/OFS/DTMLMethod.py,
			  line 127, in __call__
			      (Object: rpt_locations)
			        File
				/home/wilson/zope/2.5.1b1/lib/python/DocumentTemplate/DT_String.py,
				line 473, in __call__
				    (Object: rpt_locations)
				      File
				      /home/wilson/zope/2.5.1b1/lib/python/DocumentTemplate/DT_In.py,
				      line 437, in renderwb
				          (Object: qry_getlocations)
					  KeyError: (see above)
-Tim

--
wilson@visi.com