RE: SQL Method, dtml-with and namespace weirdness
Heh. Oh well, you win some, you lose some! I appear to be losing some - maybe I should drink less caffine? I can work around the problem for the moment, but either: 1) I *totally* misunderstand how dtml-with works 2) It's misbehaving itself under some circumstances To recap: two SQL method returning [different] (name,domain) are used like this: <dtml-in SQL_method1> <P>&dtml-name;</P> - POINT A <P>&dtml-domain;</P> <dtml-in SQL_method2> <P>&dtml-name;</P> - POINT B <P>&dtml-domain;</P> <dtml-with aFolder> <P>&dtml-name;</P> - POINT C <P>&dtml-domain;</P> </dtml-with> </dtml-in> </dtml-in> This will print: name1 domain1 name2 domain2 name1 domain1 That is: *inside* the dtml-with, the variables "name" and "domain" appear to be reset to their values in the *outer* dtml-in tag, not the innermost. This *only* happens if both SQL methods return variables named the same, and it *only* affects those two variables (so, I can work around it). Is this expected behaviour? Anyone who wants to see this problem can have Manager access to a test subtree I setup that reproduces the problem exactly. I realise it's far more likely that the problem lies with me - but what is the problem? Also - your comment about SQL methods vis. the DTML namespace has cleared up a longstanding confusion of mine - thanks! Regards, Phil +----------------------------------+ | Phil Mayers, Network Support | | Centre for Computing Services | | Imperial College | +----------------------------------+ -----Original Message----- From: Dieter Maurer [mailto:dieter@handshake.de] Sent: 10 January 2001 20:59 To: Mayers, Philip J Cc: 'zope@zope.org' Subject: Re: [Zope] REPOST: dtml-with doesn't work Usually, I complain that problem reports are too terse. But, your's was very big, such that I did not read it carefully. It is very difficult to get it right for everyone. Just a remark: SQL methods do *NOT* look at the DTML namespace *AT ALL*, just at REQUEST (or the expliciitly passed keyword arguments). Thus, "dtml-with", "dtml-let" and friends are all ineffective with respect to ZSQL methods. May be, that explains your problem. May be not, as I am not sure, that you need the values indeed inside a ZSQL method. I can assure you: "dtml-with" does work. Dieter _______________________________________________ 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 )
Mayers, Philip J writes:
.... To recap: two SQL method returning [different] (name,domain) are used like this:
<dtml-in SQL_method1> <P>&dtml-name;</P> - POINT A <P>&dtml-domain;</P> <dtml-in SQL_method2> <P>&dtml-name;</P> - POINT B <P>&dtml-domain;</P> <dtml-with aFolder> <P>&dtml-name;</P> - POINT C <P>&dtml-domain;</P> </dtml-with> </dtml-in> </dtml-in>
This will print:
name1 domain1
name2 domain2
name1 domain1
That is: *inside* the dtml-with, the variables "name" and "domain" appear to be reset to their values in the *outer* dtml-in tag, not the innermost. This *only* happens if both SQL methods return variables named the same, and it *only* affects those two variables (so, I can work around it). Is this expected behaviour? Now, that is a nice problem description.
The only rational explanation would be that your "aFolder" magically has access to "name" and "domain" that happen to have values "name1" and "domain1". Dieter
participants (2)
-
Dieter Maurer -
Mayers, Philip J