-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Greets. I'm (slowly) learning Zope, and loving every bit of it, but have run into a few snags. I'm quite comfortable with PHP, which I know is the source of a lot of my problems as Zope and PHP are two entirely different paradigms. There's just so much information on the Zope website, that I'm having a difficult time finding the answers to certain problems, which unfortunately have left me in somewhat of a quagmire. Can someone point me to the location where I might find more information on the following, with regards to Zope: - Variable Passing through GET request Here's what I'm trying to do: I'm trying to create a "tool-tip" (which is actually contained in a frame) and would like to pass a parameter to the DTML document which contains the HTML, etc. for the tool-tip. Something like: <a href="show_tip?a=b&c=d"> Q: Is there a magical Zope variable that contains the arguments passed on a GET URI (as in PHP?) Q: Must any variable be declared first? - "case" statement Q: Does there exist the equivalent of a shell "case" statement in Zope? (This is in line with my previous questions). Thanks in advance. Any help would be greatly appreciated. - -- George M. Ellenburg <george@ellenburg.org> <http://www.ellenburg.org/> 3 Years and counting of being 100% Microsoft-free; and much more productive. Proud user of ASK <http://www.paganini.net/ask/>, the Active Spam Killer! - --- Sweater, n.: A garment worn by a child when its mother feels chilly. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE81zIUFItzMEWZZdgRApKRAJ4tDvN/aNCTF9n0/R8VzYoRij/N1QCgi/M8 /ufg+lqQKRebOAcTE0UdAvw= =gikE -----END PGP SIGNATURE-----
Hi George, The answer is that it depends on what kind of object intercepts the GET request. If it's a DTML Method, you can just say: <dtml-var a> or if you want to use it as an argument to a function: <dtml-call "somefunction(a)"> If it's a Python Script, you need to do a bit more work: a = context.REQUEST.get('a') somefunction(a) If it's a Page Template.. it goes something like: <div tal:replace="request/a">The value of the "a" variable from the request</div> More information about all of this is available primarily in the Zope Book at http://www.zope.org/Documentation/ZopeBook/ . HTH, - C George M. Ellenburg wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Greets.
I'm (slowly) learning Zope, and loving every bit of it, but have run into a few snags. I'm quite comfortable with PHP, which I know is the source of a lot of my problems as Zope and PHP are two entirely different paradigms.
There's just so much information on the Zope website, that I'm having a difficult time finding the answers to certain problems, which unfortunately have left me in somewhat of a quagmire.
Can someone point me to the location where I might find more information on the following, with regards to Zope:
- Variable Passing through GET request
Here's what I'm trying to do: I'm trying to create a "tool-tip" (which is actually contained in a frame) and would like to pass a parameter to the DTML document which contains the HTML, etc. for the tool-tip. Something like: <a href="show_tip?a=b&c=d"> Q: Is there a magical Zope variable that contains the arguments passed on a GET URI (as in PHP?) Q: Must any variable be declared first?
- "case" statement Q: Does there exist the equivalent of a shell "case" statement in Zope? (This is in line with my previous questions).
Thanks in advance. Any help would be greatly appreciated.
- -- George M. Ellenburg <george@ellenburg.org> <http://www.ellenburg.org/> 3 Years and counting of being 100% Microsoft-free; and much more productive. Proud user of ASK <http://www.paganini.net/ask/>, the Active Spam Killer! - --- Sweater, n.: A garment worn by a child when its mother feels chilly. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org
iD8DBQE81zIUFItzMEWZZdgRApKRAJ4tDvN/aNCTF9n0/R8VzYoRij/N1QCgi/M8 /ufg+lqQKRebOAcTE0UdAvw= =gikE -----END PGP SIGNATURE-----
_______________________________________________ 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 )
-- Chris McDonough Zope Corporation http://www.zope.org http://www.zope.com "Killing hundreds of birds with thousands of stones"
On Mon, May 06, 2002 at 09:46:52PM -0400, George M. Ellenburg wrote: | Here's what I'm trying to do: | | I'm trying to create a "tool-tip" (which is actually contained in a | frame) and would like to pass a parameter to the DTML document which | contains the HTML, etc. for the tool-tip. Something like: | <a href="show_tip?a=b&c=d"> | Q: Is there a magical Zope variable that contains the arguments | passed on a GET URI (as in PHP?) Take a look at the REQUEST object. It will contain all the form parameters and other information. It is always (and only) available when an object is "called from the web". | Q: Must any variable be declared first? Variables are not declared[1] in python; but accessing a non-existant variable is an error. I'm not sure with dtml, but is probably the same way. [1] : C, C++ and Java require variable declarations. They are separate statements from assignment. | - "case" statement | Q: Does there exist the equivalent of a shell "case" statement in Zope? | (This is in line with my previous questions). Python does not have a case statement. You can use an if-else ladder instead, or use a dictionary with function objects as the values. The dictionary technique is often done like this : def handler1() : print "block 1" def handler2() : print "block 2" def handler3() : print "block 3" switch = { 'a' : handler1 , 'b' : handler2 , 'c' : handler3 } choice = raw_input( "Choose a, b, or c " ) if not switch.has_key( choice ) : print "invalid choice" else : # this is the switch/case statement here switch[choice]() I don't know if that fits in to your framework at all or not. I'm still quite inexperienced at web app design and development, though I've done a fair amount of python and java programming. HTH, -D -- I tell you the truth, everyone who sins is a slave to sin. Now a slave has no permanent place in the family, but a son belongs to it forever. So if the Son sets you free, you will be free indeed. John 8:34-36 GnuPG key : http://dman.ddts.net/~dman/public_key.gpg
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday 06 May 2002 09:46 pm, George M. Ellenburg wrote:
Can someone point me to the location where I might find more information on the following, with regards to Zope:
Thanks to all that have responded! You've given me some definite starting points. Cheers, - -- George M. Ellenburg <george@ellenburg.org> <http://www.ellenburg.org/> 3 Years and counting of being 100% Microsoft-free; and much more productive. Proud user of ASK <http://www.paganini.net/ask/>, the Active Spam Killer! - --- Cogito cogito ergo cogito sum -- "I think that I think, therefore I think that I am." -- Ambrose Bierce, "The Devil's Dictionary" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iD8DBQE816thFItzMEWZZdgRAocJAJ0RohNJiaxKAVzwsc4a+l8GzX2H8QCffMLW xMYOd+rcbUxBqIYtruCSQ/8= =AiGk -----END PGP SIGNATURE-----
"George M. Ellenburg" wrote:
I'm (slowly) learning Zope, and loving every bit of it, but have run into a few snags. I'm quite comfortable with PHP, which I know is the source of a lot of my problems as Zope and PHP are two entirely different paradigms.
There's just so much information on the Zope website, that I'm having a difficult time finding the answers to certain problems, which unfortunately have left me in somewhat of a quagmire.
Can someone point me to the location where I might find more information on the following, with regards to Zope:
http://www.dieter.handshake.de/pyprojects/zope/book/chap3.html
- Variable Passing through GET request
Here's what I'm trying to do: I'm trying to create a "tool-tip" (which is actually contained in a frame) and would like to pass a parameter to the DTML document which contains the HTML, etc. for the tool-tip. Something like: <a href="show_tip?a=b&c=d"> Q: Is there a magical Zope variable that contains the arguments passed on a GET URI (as in PHP?) Q: Must any variable be declared first?
the object is usually called request ( or REQUEST ), ZPublisher marshals them for you http://www.zope.org/Members/Zen/howto/FormVariableTypes
- "case" statement Q: Does there exist the equivalent of a shell "case" statement in Zope? (This is in line with my previous questions).
no -- ------------------------------------------------------------- Who's got only a hammer sees the world as a nail hans augustin (software developer) hans@beehive.de beehive elektronische medien GmbH http://www.beehive.de phone: +49 30 847-82 0 fax: +49 30 847-82 299
participants (4)
-
Chris McDonough -
dman -
George M. Ellenburg -
hans