[Zope] REQUEST not available in SQL Methods?

Alexander Schonfeld alex@garage.co.jp
Wed, 26 Apr 2000 10:30:39 +0900


> On Zope 2.1.6, Zodbcda (3.1.0b2 newest... I think), WinNT:

When I try something like:
---
  <dtml-with REQUEST>
     select * from asdf
  </dtml-with>
---
I get errors like this:

Error type: KeyError Error value: 
Error type: KeyError Error value: REQUEST ERROR MESSAGE   Zope    
 Z SQL Method at /hide / testNetworkSQL  
SQL used:
Could not render the query template!
--------------------------------------------------------------------------------
Error, exceptions.KeyError: REQUEST 
--------------------------------------------------------------------------------
Traceback (innermost last):
  File D:\SONICN~2\lib\python\ZPublisher\Publish.py, line 214, in publish_module
  File D:\SONICN~2\lib\python\ZPublisher\Publish.py, line 179, in publish
  File D:\SONICN~2\lib\python\Zope\__init__.py, line 202, in zpublisher_exception_hook
    (Object: testNetworkSQL)
  File D:\SONICN~2\lib\python\ZPublisher\Publish.py, line 165, in publish
  File D:\SONICN~2\lib\python\ZPublisher\mapply.py, line 160, in mapply
    (Object: manage_test)
  File D:\SONICN~2\lib\python\ZPublisher\Publish.py, line 102, in call_object
    (Object: manage_test)
  File D:\SONICN~2\lib\python\Shared\DC\ZRDB\DA.py, line 331, in manage_test
    (Object: testNetworkSQL)
  File D:\SONICN~2\lib\python\Shared\DC\ZRDB\DA.py, line 310, in manage_test
    (Object: testNetworkSQL)
  File D:\SONICN~2\lib\python\Shared\DC\ZRDB\DA.py, line 424, in __call__
    (Object: testNetworkSQL)
  File D:\SONICN~2\lib\python\DocumentTemplate\DT_String.py, line 502, in __call__
    (Object: <string>)
  File D:\SONICN~2\lib\python\DocumentTemplate\DT_With.py, line 132, in render
    (Object: REQUEST)
KeyError: (see above)




On Tue, 25 Apr 2000 08:53:32 -0500
"Jim Sanford" <jsanford@atinucleus.com> wrote:

> I just  start and end my ZSQL methods with <dtml-with REQUEST> and </dtml-with>
> ----- Original Message ----- 
> From: Alexander Schonfeld <alex@garage.co.jp>
> To: <zope@zope.org>
> Sent: Tuesday, April 25, 2000 4:26 AM
> Subject: [Zope] REQUEST.set in ZSQL Methods?
> 
> 
> On Zope 2.1.6, Zodbcda (3.1.0b2 newest... I think), WinNT:
> 
> I have some old ZSQL Methods which use the REQUEST object to store some
> variables.
> 
> I seem to be getting a name error when I try these with the newer
> zodbcda... not with the sybaseda or the old Zope and old zodbcda.
> 
> For example:
> ---
> <!--#unless "_.str(ColumnValue)[0] == '[' and
> _.str(ColumnValue)[-1] == ']'"-->
> <!--#call "REQUEST.set('ColumnValue', [ColumnValue])"-->
> <!--#/unless-->
> <!--#with REQUEST-->
> ........
> ---
> I get a NameError when it does the REQUEST.set.
> 
> Can you believe it!? Zope legacy code... :)  I have lots of these ZSQL
> Methods, so I don't really want to change all the logic... but if there
> is a simple way to pass in the REQUEST object or fix the DA that would
> be nice.  Anyone with similar problems?
> 
> Thanks,
> 
> Alex.
>  
> 1010011010
> 0  Digital Garage
> 1  Alex Schonfeld
> 0  alex@garage.co.jp - pear
> 1  090-4429-2323
> 
> 
> _______________________________________________
> 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 )
> 
> 
> 
> 
> _______________________________________________
> 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 )
> 
> 

 
1010011010
0  Digital Garage
1  Alex Schonfeld
0  alex@garage.co.jp - pear
1  090-4429-2323