Mercurial > p > roundup > code
changeset 1142:eac669d738d1 0.5.0-b2
doc
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Fri, 13 Sep 2002 04:57:38 +0000 |
| parents | efaabc87f02e |
| children | c7119e74fcf8 |
| files | doc/customizing.txt |
| diffstat | 1 files changed, 23 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/customizing.txt Fri Sep 13 04:39:12 2002 +0000 +++ b/doc/customizing.txt Fri Sep 13 04:57:38 2002 +0000 @@ -2,7 +2,7 @@ Customising Roundup =================== -:Version: $Revision: 1.33 $ +:Version: $Revision: 1.34 $ .. This document borrows from the ZopeBook section on ZPT. The original is at: http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx @@ -1026,6 +1026,28 @@ `batching`_) =============== ============================================================ +The form variable +::::::::::::::::: + +The form variable is a little special because it's actually a python +FieldStorage object. That means that you have two ways to access its +contents. For example, to look up the CGI form value for the variable +"name", use the path expression:: + + request/form/name/value + +or the python expression:: + + python:request.form['name'].value + +Note the "item" access used in the python case, and also note the explicit +"value" attribute we have to access. That's because the form variables are +stored as MiniFieldStorages. If there's more than one "name" value in +the form, then the above will break since ``request/form/name`` is actually a +*list* of MiniFieldStorages. So it's best to know beforehand what you're +dealing with. + + The db variable ~~~~~~~~~~~~~~~
