Mercurial > p > roundup > code
comparison doc/customizing.txt @ 1142:eac669d738d1 0.5.0-b2
doc
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Fri, 13 Sep 2002 04:57:38 +0000 |
| parents | 7e193bbda38e |
| children | db13f46cb5f9 |
comparison
equal
deleted
inserted
replaced
| 1141:efaabc87f02e | 1142:eac669d738d1 |
|---|---|
| 1 =================== | 1 =================== |
| 2 Customising Roundup | 2 Customising Roundup |
| 3 =================== | 3 =================== |
| 4 | 4 |
| 5 :Version: $Revision: 1.33 $ | 5 :Version: $Revision: 1.34 $ |
| 6 | 6 |
| 7 .. This document borrows from the ZopeBook section on ZPT. The original is at: | 7 .. This document borrows from the ZopeBook section on ZPT. The original is at: |
| 8 http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx | 8 http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx |
| 9 | 9 |
| 10 .. contents:: | 10 .. contents:: |
| 1023 the templating | 1023 the templating |
| 1024 batch run the current index args through a filter and return a | 1024 batch run the current index args through a filter and return a |
| 1025 list of items (see `hyperdb item wrapper`_, and | 1025 list of items (see `hyperdb item wrapper`_, and |
| 1026 `batching`_) | 1026 `batching`_) |
| 1027 =============== ============================================================ | 1027 =============== ============================================================ |
| 1028 | |
| 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 | |
| 1028 | 1050 |
| 1029 The db variable | 1051 The db variable |
| 1030 ~~~~~~~~~~~~~~~ | 1052 ~~~~~~~~~~~~~~~ |
| 1031 | 1053 |
| 1032 Note: this is implemented by the roundup.cgi.templating.HTMLDatabase class. | 1054 Note: this is implemented by the roundup.cgi.templating.HTMLDatabase class. |
