File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change 22Customising 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+
10291051The db variable
10301052~~~~~~~~~~~~~~~
10311053
You can’t perform that action at this time.
0 commit comments