Re: [Zope-dev] More ZSQL weirdness (this time with Python Scripts ;-)

2001-03-23 Thread Chris Withers

Dieter Maurer wrote:
 
   Error Type: Bad Request
   Error Value: ['sec']
 This is an old one
 
   ZSQL method's do not use the DTML namespace (where you "sec" goes to)

Slaps forhead

Thankyou, I wonder what needs to be done to make ZSQL methods work like
everything else?

cheers,

Chris

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] More ZSQL weirdness (this time with Python Scripts ;-)

2001-03-22 Thread Chris Withers

Hi,

I had the following line in a dtml method, x_report, generated by 'Add Z Search
Interface':
dtml-in x

...where x is a ZSQL Method that takes one parameter: sec

Now, when I try to call x_report from a python script, my_ps, as follows:

return container.x_report(context,context.REQUEST,sec='XXX')

...I get the following:

Error Type: Bad Request
Error Value: ['sec']


...and the only way I can stop it doing that is to change the line in x_report
to read:

dtml-in "x(sec=_.getitem('sec'))"

...which isn't very nice :-(

Has anyone seen anything similar or should I stick this in the collector?

cheers,

Chris



PS:
Traceback (innermost last):
  File /usr/zope/zope-2_3_1b3/lib/python/ZPublisher/Publish.py, line 223, in
publish_module
  File /usr/zope/zope-2_3_1b3/lib/python/ZPublisher/Publish.py, line 187, in
publish
  File /usr/zope/zope-2_3_1b3/lib/python/Zope/__init__.py, line 221, in
zpublisher_exception_hook
(Object: Traversable)
  File /usr/zope/zope-2_3_1b3/lib/python/ZPublisher/Publish.py, line 171, in
publish
  File /usr/zope/zope-2_3_1b3/lib/python/ZPublisher/mapply.py, line 160, in
mapply
(Object: my_ps)
  File /usr/zope/zope-2_3_1b3/lib/python/ZPublisher/Publish.py, line 112, in
call_object
(Object: my_ps)
  File /usr/zope/zope-2_3_1b3/lib/python/Shared/DC/Scripts/Bindings.py, line
324, in __call__
(Object: my_ps)
  File /usr/zope/zope-2_3_1b3/lib/python/Shared/DC/Scripts/Bindings.py, line
353, in _bindAndExec
(Object: my_ps)
  File /usr/zope/zope-2_3_1b3/lib/python/Products/PythonScripts/PythonScript.py,
line 336, in _exec
(Object: my_ps)
(Info: ({'script': PythonScript instance at 9067f20, 'context': Folder
instance at 90325e8, 'container': Folder instance at 90325e8,
'traverse_subpath': []}, (), {}, None))
  File Script (Python), line 2, in my_ps
(Object: lambda)
  File /usr/zope/zope-2_3_1b3/lib/python/OFS/DTMLMethod.py, line 189, in
__call__
(Object: x_report)
  File /usr/zope/zope-2_3_1b3/lib/python/DocumentTemplate/DT_String.py, line
538, in __call__
(Object: x_report)
  File /usr/zope/zope-2_3_1b3/lib/python/DocumentTemplate/DT_In.py, line 646, in
renderwob
(Object: x)
  File /usr/zope/zope-2_3_1b3/lib/python/Shared/DC/ZRDB/DA.py, line 476, in
__call__
(Object: x)
  File /usr/zope/zope-2_3_1b3/lib/python/Shared/DC/ZRDB/Aqueduct.py, line 150,
in _argdata
(Object: x)
Bad Request: (see above)

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



Re: [Zope-dev] More ZSQL weirdness (this time with Python Scripts ;-)

2001-03-22 Thread Dieter Maurer

Chris Withers writes:
  I had the following line in a dtml method, x_report, generated by 'Add Z Search
  Interface':
  dtml-in x
  
  where x is a ZSQL Method that takes one parameter: sec
  
  Now, when I try to call x_report from a python script, my_ps, as follows:
  
  return container.x_report(context,context.REQUEST,sec='XXX')
  
  I get the following:
  
  Error Type: Bad Request
  Error Value: ['sec']
This is an old one

  ZSQL method's do not use the DTML namespace (where you "sec" goes to)
  to find their arguments:

  The prototype is as follows:

 def __call__(self, REQUEST=None, __ick__=None, src__=0, test__=0, **kw)

  If the second parameter (REQUEST) is passed, it should be a
  dictionary and it is used to find the parameters.

  Otherwise, if keywords arguments are provided, the keyword dict
  is used.

  Otherwise, "REQUEST" is obtained by acquisition and used.

  Otherwise, "{}" is used.


In the future, Z SQL methods may perhaps use the new "namespace" passing
mechanism (feature request for the Locator?). But currently,
they behave as said above.


Dieter

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )