manage primitives documentation
Hi all! I just have a problem of documentation.... does anyone know where I can find the doc about all the manage_something primitives (like manage_upload(), manage_clone()...) My problem is that I want to insiantiate an abject from a method, but I can't find the good primitive..... Thanks for your attention... :^) Pio.
but I can't find the answer... can I set a local variable in zope on a dtml page eg <dtml-var variablename = 1> thanks josh on
+----[ Chris Withers ]--------------------------------------------- | josh on wrote: | > can I set a local variable in zope on a dtml page | > <dtml-var variablename = 1> | | Yup: | | <dtml-call "REQUEST.set('variablename',1)"> | | Nice syntax, huh? ;-) Tsk tsk, that's global :-) <dtml-let variablename=1> ... ... </dtml-let> -- 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 |akm@theinternet.com.au|
Is it global to the page, or local to the page ?!?!? ----- Original Message ----- From: "Andrew Kenneth Milton" <akm@mail.theinternet.com.au> To: "Chris Withers" <chrisw@nipltd.com> Cc: "josh on" <josh@zesty.com>; <zope@zope.org> 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 | > <dtml-var variablename = 1> | | Yup: | | <dtml-call "REQUEST.set('variablename',1)"> | | Nice syntax, huh? ;-)
Tsk tsk, that's global :-)
<dtml-let variablename=1> ... ... </dtml-let>
-- 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 |akm@theinternet.com.au|
_______________________________________________ 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 )
+----[ 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 |akm@theinternet.com.au|
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 | > <dtml-var variablename = 1> | | Yup: | | <dtml-call "REQUEST.set('variablename',1)"> | | Nice syntax, huh? ;-)
Tsk tsk, that's global :-)
<dtml-let variablename=1> ... ... </dtml-let>
Tsk tsk tsk - it don't work ;) <dtml-let variablename="1"> ... ... </dtml-let> 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
+----[ Tony McDonald ]--------------------------------------------- | | >Tsk tsk, that's global :-) | > | ><dtml-let variablename=1> | >... | >... | ></dtml-let> | | 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 |akm@theinternet.com.au|
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 <dtml-var variablename = 1>
Yup:
<dtml-call "REQUEST.set('variablename',1)">
Nice syntax, huh? ;-)
Chris
now now :) (tested) <dtml-let variablename="1"> blah blah blah ... ie the scope of the variable <dtml-var variablename> </dtml-let> don't fall into the trap of doing this <dtml-let variablename="I am a string"> blah blah blah ... ie the scope of the variable <dtml-var variablename> </dtml-let> '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 <dtml-let variablename="'I am a string'"> blah blah blah ... ie the scope of the variable <dtml-var variablename> </dtml-let> You can have multiple variables set too... <dtml-let variablename="'I am a string'" bloot="1"> blah blah blah ... ie the scope of the variable <dtml-var variablename> :: <dtml-var bloot> </dtml-let> 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
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 <tony.mcdonald@ncl.ac.uk> To: Zope List <zope@zope.org> 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 <dtml-var variablename = 1>
Yup:
<dtml-call "REQUEST.set('variablename',1)">
Nice syntax, huh? ;-)
Chris
now now :)
(tested)
<dtml-let variablename="1"> blah blah blah ... ie the scope of the variable <dtml-var variablename> </dtml-let>
don't fall into the trap of doing this <dtml-let variablename="I am a string"> blah blah blah ... ie the scope of the variable <dtml-var variablename> </dtml-let>
'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 <dtml-let variablename="'I am a string'"> blah blah blah ... ie the scope of the variable <dtml-var variablename> </dtml-let>
You can have multiple variables set too... <dtml-let variablename="'I am a string'" bloot="1"> blah blah blah ... ie the scope of the variable <dtml-var variablename> :: <dtml-var bloot> </dtml-let>
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 - 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 )
but I can't find the answer...
can I set a local variable in zope on a dtml page eg
<dtml-var variablename = 1>
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: <dtml-with "locals(a=1, b='a string')" mapping> <dtml-var a> <dtml-var b> <dtml-call "set(a=3, b=b[:5])"> <dtml-var a> <dtml-var b> </dtml-with> and get: 1 a string 3 a str as output. -- Duncan Booth duncan@dales.rmplc.co.uk 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
participants (7)
-
Andrew Kenneth Milton -
Chris Withers -
Duncan Booth -
josh on -
Phil Harris -
Pierre Rougier -
Tony McDonald