RE: [Zope] DTML namespace puzzle

2001-01-30 Thread Dieter Maurer

Ron Bickers writes:
  
  I realized the DTML method
  call from the Python Script included 'container' as the first parameter (as
  shown below)
  I don't understand how Python Scripts can/should call DTML methods.  That
  is, are there magical parameters?...
About a week ago, I posted a short description on how parameters
are passed to DTML objects to this list.

Take a look at the archive.


Dieter

___
Zope maillist  -  [EMAIL PROTECTED]
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 )




RE: [Zope] DTML namespace puzzle

2001-01-30 Thread Ron Bickers

It was posted to zope-dev, which I should probably subscribe to.

http://lists.zope.org/pipermail/zope-dev/2001-January/009018.html

Thank you!  Exactly what I needed.
___

Ron Bickers
Logic Etc, Inc.
[EMAIL PROTECTED]

 -Original Message-
 From: Dieter Maurer [mailto:[EMAIL PROTECTED]]

 About a week ago, I posted a short description on how parameters
 are passed to DTML objects to this list.
 
 Take a look at the archive.


___
Zope maillist  -  [EMAIL PROTECTED]
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 )




RE: [Zope] DTML namespace puzzle

2001-01-29 Thread Ron Bickers

 -Original Message-
 From: Dieter Maurer [mailto:[EMAIL PROTECTED]]
 Sent: Monday, January 29, 2001 1:17 PM
 To: Ron Bickers
 Cc: [EMAIL PROTECTED]
 Subject: RE: [Zope] DTML namespace puzzle

 of the namespace. "dtml-with" could but it is very strange
 that it should do such things and especially that it does
 for you but not for me.

I have no explanation whatsoever, but I removed the dtml-let and it's
working now.  Sigh...

This leads me to a related question, however.  I realized the DTML method
call from the Python Script included 'container' as the first parameter (as
shown below).  I did this so that the DTML method could find another method
in the same Folder.  Without it, it fails with a NameError.  I realized that
I don't understand how Python Scripts can/should call DTML methods.  That
is, are there magical parameters?  Why does the following 'container'
parameter work?

  msg = container.orderMessage(container, num=num, SESSION=SESSION)

___

Ron Bickers
Logic Etc, Inc.
[EMAIL PROTECTED]


___
Zope maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope] DTML namespace puzzle

2001-01-28 Thread Dieter Maurer

Ron Bickers writes:
  I have a Python Script (sendOrder) that calls a DTML method (orderMessage)
  as follows:
  
container.orderMessage(num=num, SESSION=SESSION)
  
  orderMessage contains the following:
  
dtml-with "SESSION['info']" mapping
Order Number: dtml-var num
Blah blah other session variables that work fine.
/dtml-with
  
  I get a KeyError on num.  If I modify orderMessage to contain the following,
  it works:
  
dtml-let num=num
dtml-with "SESSION['info']" mapping
Order Number: dtml-var num
Blah blah other session variables that work fine.
/dtml-with
/dtml-let
  
  This seems strange to me.  What am I missing?
I failed to reproduce this in my Zope CVS.

It is puzzling indeed!

Does "SESSION['info']" has a key "num" or do you expect
to access the "num" passed as parameter?
In this case, it might have something to do with permissions,
as Zope sometimes turns insufficient permissions into KeyError.
However, I expect your "SESSION['info']" is a standard dictionary
and then access should by unprotected.

Dieter

___
Zope maillist  -  [EMAIL PROTECTED]
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 )




RE: [Zope] DTML namespace puzzle

2001-01-28 Thread Ron Bickers

 -Original Message-
 From: Dieter Maurer [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, January 28, 2001 3:43 PM
 To: Ron Bickers
 Cc: [EMAIL PROTECTED]
 Subject: Re: [Zope] DTML namespace puzzle

 Does "SESSION['info']" has a key "num" or do you expect
 to access the "num" passed as parameter?
 In this case, it might have something to do with permissions,
 as Zope sometimes turns insufficient permissions into KeyError.
 However, I expect your "SESSION['info']" is a standard dictionary
 and then access should by unprotected.

SESSION['info'] does not have a key "num".  The only num is passed as a
parameter.  Did you use SQLSession to try to reproduce it, or just another
mapping?  Could SQLSession have something to do with it?
___

Ron Bickers
Logic Etc, Inc.
[EMAIL PROTECTED]


___
Zope maillist  -  [EMAIL PROTECTED]
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 )