# HG changeset patch # User Richard Jones # Date 1031893058 0 # Node ID eac669d738d11017e2547f8f6099dbca42da0004 # Parent efaabc87f02ea61c302006aea5dbffe0f1d4647b doc diff -r efaabc87f02e -r eac669d738d1 doc/customizing.txt --- 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 ~~~~~~~~~~~~~~~