Re: [Zope] RE : [Zope] NESTED IN STATEMENTS AND PASSING VARIABLES in DTML

2000-11-20 Thread Dieter Maurer

Kelvin Cheong writes:
  
  dtml-in "category_method(id='1')" size=100 start=query_start
  id=dtml-var idseq=dtml-var seqvid=dtml-var vid
  
  where can i find out more about these properties, i.e. the seq...vid... and
  so on..?
The argument to "dtml-in" is a sequence of objects.
"dtml-in" iterates over the objects.
In each iteration, "dtml-in" exports the current objects attributes
into the namespace.

Thus, "seq", "vid", ... are probably attributes of your objects.


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 )




[Zope] RE : [Zope] NESTED IN STATEMENTS AND PASSING VARIABLES in DTML

2000-11-19 Thread Kelvin Cheong


dtml-in "category_method(id='1')" size=100 start=query_start
id=dtml-var idseq=dtml-var seqvid=dtml-var vid

where can i find out more about these properties, i.e. the seq...vid... and
so on..?

thanx for any directions in advance,
later,
amoebia

VCN - The Leader In Corporate Communication Solutions
Visit our website at http://www.vcn.com.my. 
or http://www.vcnlinux.com


___
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] NESTED IN STATEMENTS AND PASSING VARIABLES in DTML

2000-07-21 Thread Dieter Maurer

[EMAIL PROTECTED] writes:
  This is FAQ material and should be inserted into either the DTML programmer's guide
  or the ZSQL Methods guide.  It bites everyone who uses SQL methods eventually.
  
  ZSQL methods do not perform acquisition, but will look at REQUEST, change it
  to.
A minor clarification of terms:

 * *acquisition* acquires attributes/methods form containing objects
   or the context of the objects use

 * DTML methods usually are passed a *namespace* containing
   name-value bindings.
   This namespace contains many variables, REQUEST and its content,
   acquired attributes/methods, variables made
   available with dtml-with, dtml-let, dtml-in, dtml-tree...


Z SQL methods do support acquisition.

They are, however, not called (automatically) with the current namespace
but only with the REQUEST object.
Thus, they can automatically use only acquired attributes/methods
and variables contained in REQUEST but not the variables defined
in an enclosing DTML method (via with, let, in, tree ).

Acquired attributes do not need tp be listed in the "Arguements"
property of the Z SQL method, REQUEST variables have to.


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] NESTED IN STATEMENTS AND PASSING VARIABLES in DTML

2000-07-20 Thread jpenny

On Thu, Jul 20, 2000 at 12:27:01PM -0500, Theodore Patrick wrote:
 What is the DTML syntax for nested in statements. Here is an example.
 
 
 EXAMPLE 1: NO VARIABLE PASSING
 
 GOAL: loop 4 times and with each loop run the category_method and print out
 the results:
 
 dtml-in "1,2,3,4"
 dtml-in "category_method(id='1')" size=100 start=query_start
 id=dtml-var idseq=dtml-var seqvid=dtml-var vid
 /dtml-in
 /dtml-in
 
 WORKS!
 
 
 EXAMPLE 2: VARIABLE PASSING
 
 GOAL: Loop in the active_category_method and for each row run the
 category_method passing a new 'id' variable and print out the results.
 
 dtml-in "active_category_method()"
 dtml-in "category_method()" size=100 start=query_start
 id=dtml-var idseq=dtml-var seqvid=dtml-var vid
 /dtml-in
 /dtml-in
 
 ERROR -- ID is not being passed to "category_method()"
 
 
 Anyone have a solution out there?
 
 NOTE: active_category_method and category_method are SQL METHODS. Where 'id'
 is and SQL_VAR for category_method.

This is FAQ material and should be inserted into either the DTML programmer's guide
or the ZSQL Methods guide.  It bites everyone who uses SQL methods eventually.

ZSQL methods do not perform acquisition, but will look at REQUEST, change it
to.
dtml-in "active_category_method()"
 dtml-call "REQUEST.set('id', id)"
 dtml-in "category_method()" size=100 start=query_start
 id=dtml-var idseq=dtml-var seqvid=dtml-var vid
 /dtml-in
 /dtml-in

If you have a lot of arguments that need to be captured, you can
build a DTML Method, say setup_category_method_parameters that
has these builds the REQUEST.  Then your dtml can look like:
dtml-in "active_category_method()"
 dtml-call setup_category_method_parameters
 dtml-in "category_method()" size=100 start=query_start
 id=dtml-var idseq=dtml-var seqvid=dtml-var vid
 /dtml-in
 /dtml-in



 
 Thanks in advance!
 
 Theodore E. Patrick
 Ishophere.com
 
 ___
 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 )
 

___
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] NESTED IN STATEMENTS AND PASSING VARIABLES in DTML

2000-07-20 Thread Theodore Patrick

THANKS A TON!!!

I just found that the following solutions works also:

I think the only difference is the id is evaluated in the namespace variable
before invoking the SQL_METHOD

dtml-in "active_category_method()"
dtml-in "category_method(id=(_['id']))" size=100 start=query_start
 id=dtml-var idseq=dtml-var seqvid=dtml-var vid
/dtml-in
/dtml-in

or

dtml-in "1,2,323,23,23"
dtml-in "category_method(id=(_['sequence_item']))" size=100
start=query_start
 id=dtml-var idseq=dtml-var seqvid=dtml-var vid
/dtml-in
/dtml-in


Your point on the SQL_METHODS is a good one! I had no idea!

Theodore E. Patrick


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 20, 2000 1:28 PM
To: Theodore Patrick
Cc: [EMAIL PROTECTED]
Subject: Re: [Zope] NESTED IN STATEMENTS AND PASSING VARIABLES in DTML


On Thu, Jul 20, 2000 at 12:27:01PM -0500, Theodore Patrick wrote:
 What is the DTML syntax for nested in statements. Here is an example.
 
 
 EXAMPLE 1: NO VARIABLE PASSING
 
 GOAL: loop 4 times and with each loop run the category_method and print
out
 the results:
 
 dtml-in "1,2,3,4"
 dtml-in "category_method(id='1')" size=100 start=query_start
 id=dtml-var idseq=dtml-var seqvid=dtml-var vid
 /dtml-in
 /dtml-in
 
 WORKS!
 
 
 EXAMPLE 2: VARIABLE PASSING
 
 GOAL: Loop in the active_category_method and for each row run the
 category_method passing a new 'id' variable and print out the results.
 
 dtml-in "active_category_method()"
 dtml-in "category_method()" size=100 start=query_start
 id=dtml-var idseq=dtml-var seqvid=dtml-var vid
 /dtml-in
 /dtml-in
 
 ERROR -- ID is not being passed to "category_method()"
 
 
 Anyone have a solution out there?
 
 NOTE: active_category_method and category_method are SQL METHODS. Where
'id'
 is and SQL_VAR for category_method.

This is FAQ material and should be inserted into either the DTML
programmer's guide
or the ZSQL Methods guide.  It bites everyone who uses SQL methods
eventually.

ZSQL methods do not perform acquisition, but will look at REQUEST, change it
to.
dtml-in "active_category_method()"
 dtml-call "REQUEST.set('id', id)"
 dtml-in "category_method()" size=100 start=query_start
 id=dtml-var idseq=dtml-var seqvid=dtml-var vid
 /dtml-in
 /dtml-in

If you have a lot of arguments that need to be captured, you can
build a DTML Method, say setup_category_method_parameters that
has these builds the REQUEST.  Then your dtml can look like:
dtml-in "active_category_method()"
 dtml-call setup_category_method_parameters
 dtml-in "category_method()" size=100 start=query_start
 id=dtml-var idseq=dtml-var seqvid=dtml-var vid
 /dtml-in
 /dtml-in



 
 Thanks in advance!
 
 Theodore E. Patrick
 Ishophere.com
 
 ___
 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 )
 

___
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] NESTED IN STATEMENTS AND PASSING VARIABLES in DTML

2000-07-20 Thread Peter Sabaini



this should work too (untestet):

 dtml-in "active_category_method()"
 dtml-in "category_method(id=id)" size=100 start=query_start
   id=dtml-var idseq=dtml-var seqvid=dtml-var vid
 /dtml-in
 /dtml-in 

('id' var should be put on the namespace by 'active_category_method()'
and gets passed in to 'category_method()' (which, being a zsqlmethod,
wouldnt take a var from the namespace)

peter.

-- 

_
peter sabaini, mailto: [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 )