Re: [Zope] stupid question I guess

2000-06-08 Thread Duncan Booth

> but I can't find the answer...
> 
> can I set a local variable in zope on a dtml page
> eg
> 
> 

I had a few thoughts on creating writeable local variables so I put 
them down in a HowTo. See
http://www.zope.org/Members/Duncan/LocalVars
for instructions on a different way to manipulate local variables in 
Zope. Basically, by addinga small python method, it lets you write 
code like:
 
  
  
 
  
  

and get:
   1 a string 3 a str 
as output.

-- 
Duncan Booth [EMAIL PROTECTED]
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?
http://dales.rmplc.co.uk/Duncan

___
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] stupid question I guess

2000-06-08 Thread Tony McDonald

At 7:07 pm +0100 7/6/00, josh on wrote:
>  > sure - where is it? :)
>
>great question, it took me ages to finds this again, I think it could be
>linked from zope resources, or documentation,
>
>it is in in the zdp:
>
>http://zdp.zope.org/projects/zfaq/faq/DTML#951171060
>
>this is a link to the appropriate section, there is an answer to the
>question, how do I define variables in zope, which has the dtml-let answer,
>but it is less explicit and fleshed out than yours.
>
>josh on

Ok, I've uploaded it to the FAQ, but 'cos I didn't read the docs. 
it's uploaded as the contents of the email I sent ;) -  it's 
readable, just seems a little out of context..

tone
--
Dr Tony McDonald,  FMCC, Networked Learning Environments Project 
http://nle.ncl.ac.uk/
The Medical School, Newcastle University Tel: +44 191 222 5888
Fingerprint: 3450 876D FA41 B926 D3DD  F8C3 F2D0 C3B9 8B38 18A2

___
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] stupid question I guess

2000-06-07 Thread josh on

> sure - where is it? :)

great question, it took me ages to finds this again, I think it could be
linked from zope resources, or documentation,

it is in in the zdp:

http://zdp.zope.org/projects/zfaq/faq/DTML#951171060

this is a link to the appropriate section, there is an answer to the
question, how do I define variables in zope, which has the dtml-let answer,
but it is less explicit and fleshed out than yours.

josh on




___
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] stupid question I guess

2000-06-07 Thread Chris Withers

josh on wrote:
> 
> wow great answer, thanks that has just peeled off another layer of zope
> mystery for me.
> 
> can this be put in the dynamic faq?

what dynamic FAQ? 

Chris

___
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] stupid question I guess

2000-06-07 Thread josh on

wow great answer, thanks that has just peeled off another layer of zope
mystery for me.

can this be put in the dynamic faq?

josh on


- Original Message -
From: Tony McDonald <[EMAIL PROTECTED]>
To: Zope List <[EMAIL PROTECTED]>
Sent: Wednesday, June 07, 2000 3:17 PM
Subject: Re: [Zope] stupid question I guess


> At 2:55 pm +0100 7/6/00, Chris Withers wrote:
> >josh on wrote:
> >>  can I set a local variable in zope on a dtml page
> >>  
> >
> >Yup:
> >
> >
> >
> >Nice syntax, huh? ;-)
> >
> >Chris
>
> now now :)
>
> (tested)
>
> 
> blah blah blah ... ie the scope of the variable
> 
> 
>
> don't fall into the trap of doing this
> 
> blah blah blah ... ie the scope of the variable
> 
> 
>
> 'cos Zope won't let you enter it (it thinks that the 'I' is a
> variable name). Remember that anything in " " is evaluated as a
> Python expression...
>
> try this instead
> 
> blah blah blah ... ie the scope of the variable
> 
> 
>
> You can have multiple variables set too...
> 
> blah blah blah ... ie the scope of the variable
>  :: 
> 
>
> See lib/python/DocumentTemplate/DT_Let.py for more details...
>
> hth
> tone
>
>
> --
> Dr Tony McDonald,  FMCC, Networked Learning Environments Project
> http://nle.ncl.ac.uk/
> The Medical School, Newcastle University Tel: +44 191 222 5888
> Fingerprint: 3450 876D FA41 B926 D3DD  F8C3 F2D0 C3B9 8B38 18A2
>
> ___
> 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] stupid question I guess

2000-06-07 Thread Andrew Kenneth Milton

+[ Tony McDonald ]-
|
| >Tsk tsk, that's global :-)
| >
| >
| >...
| >...
| >
| 
| Tsk tsk tsk - it don't work ;)

Yeah I'm busted, I use REQUEST.set() d8)

-- 
Totally Holistic Enterprises Internet|  P:+61 7 3870 0066   | Andrew Milton
The Internet (Aust) Pty Ltd  |  F:+61 7 3870 4477   | 
ACN: 082 081 472 |  M:+61 416 022 411   | Carpe Daemon
PO Box 837 Indooroopilly QLD 4068|[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] stupid question I guess

2000-06-07 Thread Andrew Kenneth Milton

+[ Phil Harris ]-
|
| Is it global to the page, or local to the page ?!?!?

It's global to all methods you call from that point onwards.


-- 
Totally Holistic Enterprises Internet|  P:+61 7 3870 0066   | Andrew Milton
The Internet (Aust) Pty Ltd  |  F:+61 7 3870 4477   | 
ACN: 082 081 472 |  M:+61 416 022 411   | Carpe Daemon
PO Box 837 Indooroopilly QLD 4068|[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] stupid question I guess

2000-06-07 Thread Petr Knapek


Look at dtml-let tag. It is what are you looking for. Any other way is
REQUEST.set (name, value).

> On Wed, 7 Jun 2000 14:48:37 +0100, "josh on" <[EMAIL PROTECTED]> said:

jo> but I can't find the answer...  can I set a local variable in
jo> zope on a dtml page eg

jo> 

jo> thanks josh on

Petr
-- 
Petr Knápek
NEXTRA Czech Republic, s.r.o., Veveří 102, 659 10 Brno, Czech Republic
e-mail: mailto:[EMAIL PROTECTED]
tel:+420-5-41 558 394
FAX:+420-5-41 558 390

"Perl is worse than Python because people wanted it worse."
Larry Wall, 14 Oct 1998

___
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] stupid question I guess

2000-06-07 Thread Tony McDonald

At 12:05 am +1000 8/6/00, Andrew Kenneth Milton wrote:
>+[ Chris Withers ]-
>| josh on wrote:
>| > can I set a local variable in zope on a dtml page
>| > 
>|
>| Yup:
>|
>| 
>|
>| Nice syntax, huh? ;-)
>
>Tsk tsk, that's global :-)
>
>
>...
>...
>

Tsk tsk tsk - it don't work ;)

...
...


tone..


--
Dr Tony McDonald,  FMCC, Networked Learning Environments Project 
http://nle.ncl.ac.uk/
The Medical School, Newcastle University Tel: +44 191 222 5888
Fingerprint: 3450 876D FA41 B926 D3DD  F8C3 F2D0 C3B9 8B38 18A2

___
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] stupid question I guess

2000-06-07 Thread Tony McDonald

At 2:55 pm +0100 7/6/00, Chris Withers wrote:
>josh on wrote:
>>  can I set a local variable in zope on a dtml page
>>  
>
>Yup:
>
>
>
>Nice syntax, huh? ;-)
>
>Chris

now now :)

(tested)


blah blah blah ... ie the scope of the variable



don't fall into the trap of doing this

blah blah blah ... ie the scope of the variable



'cos Zope won't let you enter it (it thinks that the 'I' is a 
variable name). Remember that anything in " " is evaluated as a 
Python expression...

try this instead

blah blah blah ... ie the scope of the variable



You can have multiple variables set too...

blah blah blah ... ie the scope of the variable
 :: 


See lib/python/DocumentTemplate/DT_Let.py for more details...

hth
tone


--
Dr Tony McDonald,  FMCC, Networked Learning Environments Project 
http://nle.ncl.ac.uk/
The Medical School, Newcastle University Tel: +44 191 222 5888
Fingerprint: 3450 876D FA41 B926 D3DD  F8C3 F2D0 C3B9 8B38 18A2

___
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] stupid question I guess

2000-06-07 Thread Phil Harris

Is it global to the page, or local to the page ?!?!?


- Original Message -
From: "Andrew Kenneth Milton" <[EMAIL PROTECTED]>
To: "Chris Withers" <[EMAIL PROTECTED]>
Cc: "josh on" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, June 07, 2000 3:05 PM
Subject: Re: [Zope] stupid question I guess


> +[ Chris Withers ]-
> | josh on wrote:
> | > can I set a local variable in zope on a dtml page
> | > 
> |
> | Yup:
> |
> | 
> |
> | Nice syntax, huh? ;-)
>
> Tsk tsk, that's global :-)
>
> 
> ...
> ...
> 
>
> --
> Totally Holistic Enterprises Internet|  P:+61 7 3870 0066   | Andrew
Milton
> The Internet (Aust) Pty Ltd  |  F:+61 7 3870 4477   |
> ACN: 082 081 472 |  M:+61 416 022 411   | Carpe Daemon
> PO Box 837 Indooroopilly QLD 4068|[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 )


___
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] stupid question I guess

2000-06-07 Thread Andrew Kenneth Milton

+[ Chris Withers ]-
| josh on wrote:
| > can I set a local variable in zope on a dtml page
| > 
| 
| Yup:
| 
| 
| 
| Nice syntax, huh? ;-)

Tsk tsk, that's global :-)


...
...


-- 
Totally Holistic Enterprises Internet|  P:+61 7 3870 0066   | Andrew Milton
The Internet (Aust) Pty Ltd  |  F:+61 7 3870 4477   | 
ACN: 082 081 472 |  M:+61 416 022 411   | Carpe Daemon
PO Box 837 Indooroopilly QLD 4068|[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] stupid question I guess

2000-06-07 Thread Chris Withers

josh on wrote:
> can I set a local variable in zope on a dtml page
> 

Yup:



Nice syntax, huh? ;-)

Chris

___
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] stupid question I guess

2000-06-07 Thread josh on

but I can't find the answer...

can I set a local variable in zope on a dtml page
eg



thanks josh on


___
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 )