Skip to content

Commit 6785188

Browse files
author
Richard Jones
committed
doc
1 parent 3336b8c commit 6785188

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

doc/customizing.txt

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Customising Roundup
33
===================
44

5-
:Version: $Revision: 1.33 $
5+
:Version: $Revision: 1.34 $
66

77
.. This document borrows from the ZopeBook section on ZPT. The original is at:
88
http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx
@@ -1026,6 +1026,28 @@ batch run the current index args through a filter and return a
10261026
`batching`_)
10271027
=============== ============================================================
10281028

1029+
The form variable
1030+
:::::::::::::::::
1031+
1032+
The form variable is a little special because it's actually a python
1033+
FieldStorage object. That means that you have two ways to access its
1034+
contents. For example, to look up the CGI form value for the variable
1035+
"name", use the path expression::
1036+
1037+
request/form/name/value
1038+
1039+
or the python expression::
1040+
1041+
python:request.form['name'].value
1042+
1043+
Note the "item" access used in the python case, and also note the explicit
1044+
"value" attribute we have to access. That's because the form variables are
1045+
stored as MiniFieldStorages. If there's more than one "name" value in
1046+
the form, then the above will break since ``request/form/name`` is actually a
1047+
*list* of MiniFieldStorages. So it's best to know beforehand what you're
1048+
dealing with.
1049+
1050+
10291051
The db variable
10301052
~~~~~~~~~~~~~~~
10311053

0 commit comments

Comments
 (0)