<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><title>Python: module pyweblib.forms</title> </head><body bgcolor="#f0f0f8"> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> <tr bgcolor="#7799ee"> <td valign=bottom> <br> <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="pyweblib.html"><font color="#ffffff">pyweblib</font></a>.forms</strong></big></big> (version 0.15.0)</font></td ><td align=right valign=bottom ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/usr/lib/python2.3/site-packages/pyweblib/forms.py">/usr/lib/python2.3/site-packages/pyweblib/forms.py</a></font></td></tr></table> <p><tt>pyweblib.forms - class library for handling <FORM> input<br> (c) by Michael Stroeder <michael@stroeder.com><br> <br> This module is distributed under the terms of the<br> GPL (GNU GENERAL PUBLIC LICENSE) Version 2<br> (see <a href="http://www.gnu.org/copyleft/gpl.html">http://www.gnu.org/copyleft/gpl.html</a>)<br> <br> Python compability note:<br> This module only works with Python 2.0 since all string parameters<br> are assumed to be Unicode objects and string methods are used instead<br> string module.<br> <br> $Id: pyweblib.forms.html,v 1.17 2004/08/24 10:26:30 michael Exp $</tt></p> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#aa55cc"> <td colspan=3 valign=bottom> <br> <font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr> <tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="pyweblib.helper.html">pyweblib.helper</a><br> <a href="re.html">re</a><br> </td><td width="25%" valign=top><a href="sys.html">sys</a><br> <a href="types.html">types</a><br> </td><td width="25%" valign=top><a href="urllib.html">urllib</a><br> </td><td width="25%" valign=top></td></tr></table></td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ee77aa"> <td colspan=3 valign=bottom> <br> <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> <td width="100%"><dl> <dt><font face="helvetica, arial"><a href="exceptions.html#Exception">exceptions.Exception</a> </font></dt><dd> <dl> <dt><font face="helvetica, arial"><a href="pyweblib.forms.html#FormException">FormException</a> </font></dt><dd> <dl> <dt><font face="helvetica, arial"><a href="pyweblib.forms.html#ContentLengthExceeded">ContentLengthExceeded</a> </font></dt><dt><font face="helvetica, arial"><a href="pyweblib.forms.html#InvalidFormEncoding">InvalidFormEncoding</a> </font></dt><dt><font face="helvetica, arial"><a href="pyweblib.forms.html#InvalidRequestMethod">InvalidRequestMethod</a> </font></dt><dt><font face="helvetica, arial"><a href="pyweblib.forms.html#InvalidValueFormat">InvalidValueFormat</a> </font></dt><dt><font face="helvetica, arial"><a href="pyweblib.forms.html#InvalidValueLen">InvalidValueLen</a> </font></dt><dt><font face="helvetica, arial"><a href="pyweblib.forms.html#ParamsMissing">ParamsMissing</a> </font></dt><dt><font face="helvetica, arial"><a href="pyweblib.forms.html#TooManyValues">TooManyValues</a> </font></dt><dt><font face="helvetica, arial"><a href="pyweblib.forms.html#UndeclaredFieldName">UndeclaredFieldName</a> </font></dt></dl> </dd> </dl> </dd> <dt><font face="helvetica, arial"><a href="pyweblib.forms.html#Field">Field</a> </font></dt><dd> <dl> <dt><font face="helvetica, arial"><a href="pyweblib.forms.html#Checkbox">Checkbox</a> </font></dt><dt><font face="helvetica, arial"><a href="pyweblib.forms.html#Input">Input</a> </font></dt><dd> <dl> <dt><font face="helvetica, arial"><a href="pyweblib.forms.html#File">File</a> </font></dt><dt><font face="helvetica, arial"><a href="pyweblib.forms.html#HiddenInput">HiddenInput</a> </font></dt><dt><font face="helvetica, arial"><a href="pyweblib.forms.html#Password">Password</a> </font></dt></dl> </dd> <dt><font face="helvetica, arial"><a href="pyweblib.forms.html#Keygen">Keygen</a> </font></dt><dt><font face="helvetica, arial"><a href="pyweblib.forms.html#Radio">Radio</a> </font></dt><dd> <dl> <dt><font face="helvetica, arial"><a href="pyweblib.forms.html#Select">Select</a> </font></dt></dl> </dd> <dt><font face="helvetica, arial"><a href="pyweblib.forms.html#Textarea">Textarea</a> </font></dt></dl> </dd> <dt><font face="helvetica, arial"><a href="pyweblib.forms.html#Form">Form</a> </font></dt></dl> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> <font color="#000000" face="helvetica, arial"><a name="Checkbox">class <strong>Checkbox</strong></a>(<a href="pyweblib.forms.html#Field">Field</a>)</font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> <td colspan=2><tt>Check boxes:<br> <INPUT TYPE=CHECKBOX><br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> <dl><dt><a name="Checkbox-__init__"><strong>__init__</strong></a>(self, name, text, maxValues<font color="#909090">=1</font>, required<font color="#909090">=0</font>, accessKey<font color="#909090">=''</font>, default<font color="#909090">=None</font>, checked<font color="#909090">=0</font>)</dt><dd><tt>pattern and maxLen are determined by default</tt></dd></dl> <dl><dt><a name="Checkbox-inputHTML"><strong>inputHTML</strong></a>(self, default<font color="#909090">=None</font>, id_value<font color="#909090">=None</font>, title<font color="#909090">=None</font>, checked<font color="#909090">=None</font>)</dt></dl> <hr> Methods inherited from <a href="pyweblib.forms.html#Field">Field</a>:<br> <dl><dt><a name="Checkbox-getValue"><strong>getValue</strong></a>(self)</dt><dd><tt>Returns self.<strong>value</strong> in case of multi-valued input or<br> self.<strong>value</strong>[0] if only one value is allowed.</tt></dd></dl> <dl><dt><a name="Checkbox-idAttrStr"><strong>idAttrStr</strong></a>(self, id_value)</dt></dl> <dl><dt><a name="Checkbox-labelHTML"><strong>labelHTML</strong></a>(self, labelText<font color="#909090">=None</font>, for_value<font color="#909090">=None</font>)</dt></dl> <dl><dt><a name="Checkbox-setCharset"><strong>setCharset</strong></a>(self, charset)</dt><dd><tt>Define the character set of the user's input.</tt></dd></dl> <dl><dt><a name="Checkbox-setDefault"><strong>setDefault</strong></a>(self, default)</dt><dd><tt>Set the default of a field.<br> <br> Mainly this is used by the application if self.<strong>default</strong> shall<br> be changed after initializing the field object.</tt></dd></dl> <dl><dt><a name="Checkbox-setRegex"><strong>setRegex</strong></a>(self, pattern)</dt><dd><tt>Set the regex pattern for validating this field.<br> <br> Mainly this is used if self.<strong>_re</strong> shall be changed after<br> the field object was initialized.<br> <br> pattern<br> Either a string containing a regex pattern,<br> a tuple (pattern string, pattern options) or None.<br> If None regex checking in _validateFormat is switched off<br> (not recommended).</tt></dd></dl> <dl><dt><a name="Checkbox-setValue"><strong>setValue</strong></a>(self, value)</dt><dd><tt>Store the user's value into the field object.<br> <br> This method can be used to modify the user's value<br> before storing it into self.<strong>value</strong>.</tt></dd></dl> <dl><dt><a name="Checkbox-valueHTML"><strong>valueHTML</strong></a>(self)</dt><dd><tt>HTML output of self.<strong>value</strong> using the HTML template string<br> in self.<strong>valueHTMLTemplate</strong>.</tt></dd></dl> </td></tr></table> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> <font color="#000000" face="helvetica, arial"><a name="ContentLengthExceeded">class <strong>ContentLengthExceeded</strong></a>(<a href="pyweblib.forms.html#FormException">FormException</a>)</font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> <td colspan=2><tt>Overall length of input data too large.<br> <br> Attributes:<br> contentLength received content length<br> maxContentLength maximum valid content length<br> </tt></td></tr> <tr><td> </td> <td width="100%"><dl><dt>Method resolution order:</dt> <dd><a href="pyweblib.forms.html#ContentLengthExceeded">ContentLengthExceeded</a></dd> <dd><a href="pyweblib.forms.html#FormException">FormException</a></dd> <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="ContentLengthExceeded-__init__"><strong>__init__</strong></a>(self, contentLength, maxContentLength)</dt></dl> <dl><dt><a name="ContentLengthExceeded-__str__"><strong>__str__</strong></a>(self)</dt></dl> <hr> Methods inherited from <a href="pyweblib.forms.html#FormException">FormException</a>:<br> <dl><dt><a name="ContentLengthExceeded-html"><strong>html</strong></a>(self)</dt></dl> <hr> Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> <dl><dt><a name="ContentLengthExceeded-__getitem__"><strong>__getitem__</strong></a>(...)</dt></dl> </td></tr></table> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> <font color="#000000" face="helvetica, arial"><a name="Field">class <strong>Field</strong></a></font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> <td colspan=2><tt>Base class for all kind of single input fields.<br> <br> In most cases this class is not used directly<br> since derivate classes for most types of input fields exist.<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> <dl><dt><a name="Field-__init__"><strong>__init__</strong></a>(self, name, text, maxLen, maxValues, pattern, required<font color="#909090">=0</font>, default<font color="#909090">=None</font>, accessKey<font color="#909090">=''</font>)</dt><dd><tt>name<br> <a href="#Field">Field</a> name used in <INPUT NAME=".."><br> text<br> User-friendly text describing this field<br> maxLen<br> maximum length of a single input value [Bytes]<br> maxValues<br> maximum amount of input values<br> default<br> default value to be used in method inputfield()<br> required<br> flag which marks field as mandantory input field<br> accessKey<br> key for accessing this field to be displayed by method inputHTML()<br> pattern<br> regex pattern of valid values either as string<br> or tuple (pattern,options)</tt></dd></dl> <dl><dt><a name="Field-getValue"><strong>getValue</strong></a>(self)</dt><dd><tt>Returns self.<strong>value</strong> in case of multi-valued input or<br> self.<strong>value</strong>[0] if only one value is allowed.</tt></dd></dl> <dl><dt><a name="Field-idAttrStr"><strong>idAttrStr</strong></a>(self, id_value)</dt></dl> <dl><dt><a name="Field-labelHTML"><strong>labelHTML</strong></a>(self, labelText<font color="#909090">=None</font>, for_value<font color="#909090">=None</font>)</dt></dl> <dl><dt><a name="Field-setCharset"><strong>setCharset</strong></a>(self, charset)</dt><dd><tt>Define the character set of the user's input.</tt></dd></dl> <dl><dt><a name="Field-setDefault"><strong>setDefault</strong></a>(self, default)</dt><dd><tt>Set the default of a field.<br> <br> Mainly this is used by the application if self.<strong>default</strong> shall<br> be changed after initializing the field object.</tt></dd></dl> <dl><dt><a name="Field-setRegex"><strong>setRegex</strong></a>(self, pattern)</dt><dd><tt>Set the regex pattern for validating this field.<br> <br> Mainly this is used if self.<strong>_re</strong> shall be changed after<br> the field object was initialized.<br> <br> pattern<br> Either a string containing a regex pattern,<br> a tuple (pattern string, pattern options) or None.<br> If None regex checking in _validateFormat is switched off<br> (not recommended).</tt></dd></dl> <dl><dt><a name="Field-setValue"><strong>setValue</strong></a>(self, value)</dt><dd><tt>Store the user's value into the field object.<br> <br> This method can be used to modify the user's value<br> before storing it into self.<strong>value</strong>.</tt></dd></dl> <dl><dt><a name="Field-valueHTML"><strong>valueHTML</strong></a>(self)</dt><dd><tt>HTML output of self.<strong>value</strong> using the HTML template string<br> in self.<strong>valueHTMLTemplate</strong>.</tt></dd></dl> </td></tr></table> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> <font color="#000000" face="helvetica, arial"><a name="File">class <strong>File</strong></a>(<a href="pyweblib.forms.html#Input">Input</a>)</font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> <td colspan=2><tt><a href="#File">File</a> upload field<br> <input type="file"><br> </tt></td></tr> <tr><td> </td> <td width="100%"><dl><dt>Method resolution order:</dt> <dd><a href="pyweblib.forms.html#File">File</a></dd> <dd><a href="pyweblib.forms.html#Input">Input</a></dd> <dd><a href="pyweblib.forms.html#Field">Field</a></dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="File-inputHTML"><strong>inputHTML</strong></a>(self, default<font color="#909090">=None</font>, id_value<font color="#909090">=None</font>, title<font color="#909090">=None</font>, mimeType<font color="#909090">=None</font>)</dt></dl> <hr> Data and other attributes defined here:<br> <dl><dt><strong>mimeType</strong> = 'application/octet-stream'</dl> <hr> Methods inherited from <a href="pyweblib.forms.html#Input">Input</a>:<br> <dl><dt><a name="File-__init__"><strong>__init__</strong></a>(self, name, text, maxLen, maxValues, pattern, required<font color="#909090">=0</font>, default<font color="#909090">=None</font>, accessKey<font color="#909090">=''</font>, size<font color="#909090">=None</font>)</dt></dl> <hr> Methods inherited from <a href="pyweblib.forms.html#Field">Field</a>:<br> <dl><dt><a name="File-getValue"><strong>getValue</strong></a>(self)</dt><dd><tt>Returns self.<strong>value</strong> in case of multi-valued input or<br> self.<strong>value</strong>[0] if only one value is allowed.</tt></dd></dl> <dl><dt><a name="File-idAttrStr"><strong>idAttrStr</strong></a>(self, id_value)</dt></dl> <dl><dt><a name="File-labelHTML"><strong>labelHTML</strong></a>(self, labelText<font color="#909090">=None</font>, for_value<font color="#909090">=None</font>)</dt></dl> <dl><dt><a name="File-setCharset"><strong>setCharset</strong></a>(self, charset)</dt><dd><tt>Define the character set of the user's input.</tt></dd></dl> <dl><dt><a name="File-setDefault"><strong>setDefault</strong></a>(self, default)</dt><dd><tt>Set the default of a field.<br> <br> Mainly this is used by the application if self.<strong>default</strong> shall<br> be changed after initializing the field object.</tt></dd></dl> <dl><dt><a name="File-setRegex"><strong>setRegex</strong></a>(self, pattern)</dt><dd><tt>Set the regex pattern for validating this field.<br> <br> Mainly this is used if self.<strong>_re</strong> shall be changed after<br> the field object was initialized.<br> <br> pattern<br> Either a string containing a regex pattern,<br> a tuple (pattern string, pattern options) or None.<br> If None regex checking in _validateFormat is switched off<br> (not recommended).</tt></dd></dl> <dl><dt><a name="File-setValue"><strong>setValue</strong></a>(self, value)</dt><dd><tt>Store the user's value into the field object.<br> <br> This method can be used to modify the user's value<br> before storing it into self.<strong>value</strong>.</tt></dd></dl> <dl><dt><a name="File-valueHTML"><strong>valueHTML</strong></a>(self)</dt><dd><tt>HTML output of self.<strong>value</strong> using the HTML template string<br> in self.<strong>valueHTMLTemplate</strong>.</tt></dd></dl> </td></tr></table> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> <font color="#000000" face="helvetica, arial"><a name="Form">class <strong>Form</strong></a></font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> <td colspan=2><tt>Class for declaring and processing a whole <form><br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> <dl><dt><a name="Form-__init__"><strong>__init__</strong></a>(self, inf, env)</dt><dd><tt>Initialize a <a href="#Form">Form</a><br> inf Read from this file object if method is POST.<br> env Dictionary holding the environment vars.</tt></dd></dl> <dl><dt><a name="Form-addField"><strong>addField</strong></a>(self, f)</dt><dd><tt>Add a input field object f to the form.</tt></dd></dl> <dl><dt><a name="Form-checkRequestMethod"><strong>checkRequestMethod</strong></a>(self)</dt><dd><tt>Checks whether the HTTP request method is accepted</tt></dd></dl> <dl><dt><a name="Form-getContentType"><strong>getContentType</strong></a>(self)</dt><dd><tt>Determine the HTTP content type of HTTP request</tt></dd></dl> <dl><dt><a name="Form-getInputFields"><strong>getInputFields</strong></a>(self, ignoreEmptyFields<font color="#909090">=0</font>, ignoreUndeclaredFields<font color="#909090">=0</font>, stripValues<font color="#909090">=1</font>, unquotePlus<font color="#909090">=0</font>)</dt><dd><tt>Process user's <form> input and store the values in each<br> field instance's content attribute.<br> <br> When a processing error occurs <a href="#FormException">FormException</a> (or derivatives)<br> are raised.<br> <br> ignoreEmptyFields=0 Ignore fields with empty input.<br> ignoreUndeclaredFields=0 Ignore fields with names not declared.<br> Normally <a href="#UndeclaredFieldName">UndeclaredFieldName</a> is raised.<br> stripValues=1 If true leading and trailing whitespaces<br> are stripped from all input values.<br> unquotePlus=0<br> If non-zero urllib.unquote_plus() is used instead of urllib.unquote().</tt></dd></dl> <dl><dt><a name="Form-getInputValue"><strong>getInputValue</strong></a>(self, name, default<font color="#909090">=[]</font>)</dt><dd><tt>Return input value of a field defined by name if presented<br> in form input. Return default else.</tt></dd></dl> <dl><dt><a name="Form-hiddenInputFields"><strong>hiddenInputFields</strong></a>(self, outf<font color="#909090">=<open file '<stdout>', mode 'w'></font>, ignoreFieldNames<font color="#909090">=[]</font>)</dt><dd><tt>Output all parameters as hidden fields.<br> <br> outf<br> <a href="#File">File</a> object for output.<br> ignoreFieldNames<br> Names of parameters to be excluded.</tt></dd></dl> </td></tr></table> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> <font color="#000000" face="helvetica, arial"><a name="FormException">class <strong>FormException</strong></a>(<a href="exceptions.html#Exception">exceptions.Exception</a>)</font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> <td colspan=2><tt>Base exception class to indicate form processing errors.<br> <br> Attributes:<br> args unstructured List of parameters<br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> <dl><dt><a name="FormException-__init__"><strong>__init__</strong></a>(self, *args, **kwargs)</dt></dl> <dl><dt><a name="FormException-html"><strong>html</strong></a>(self)</dt></dl> <hr> Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> <dl><dt><a name="FormException-__getitem__"><strong>__getitem__</strong></a>(...)</dt></dl> <dl><dt><a name="FormException-__str__"><strong>__str__</strong></a>(...)</dt></dl> </td></tr></table> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> <font color="#000000" face="helvetica, arial"><a name="HiddenInput">class <strong>HiddenInput</strong></a>(<a href="pyweblib.forms.html#Input">Input</a>)</font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> <td colspan=2><tt>Hidden input field:<br> <input type="hidden"><br> </tt></td></tr> <tr><td> </td> <td width="100%"><dl><dt>Method resolution order:</dt> <dd><a href="pyweblib.forms.html#HiddenInput">HiddenInput</a></dd> <dd><a href="pyweblib.forms.html#Input">Input</a></dd> <dd><a href="pyweblib.forms.html#Field">Field</a></dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="HiddenInput-__init__"><strong>__init__</strong></a>(self, name, text, maxLen, maxValues, pattern, required<font color="#909090">=0</font>, default<font color="#909090">=None</font>, accessKey<font color="#909090">=''</font>)</dt></dl> <dl><dt><a name="HiddenInput-inputHTML"><strong>inputHTML</strong></a>(self, default<font color="#909090">=None</font>, id_value<font color="#909090">=None</font>, title<font color="#909090">=None</font>, show<font color="#909090">=0</font>)</dt></dl> <hr> Methods inherited from <a href="pyweblib.forms.html#Field">Field</a>:<br> <dl><dt><a name="HiddenInput-getValue"><strong>getValue</strong></a>(self)</dt><dd><tt>Returns self.<strong>value</strong> in case of multi-valued input or<br> self.<strong>value</strong>[0] if only one value is allowed.</tt></dd></dl> <dl><dt><a name="HiddenInput-idAttrStr"><strong>idAttrStr</strong></a>(self, id_value)</dt></dl> <dl><dt><a name="HiddenInput-labelHTML"><strong>labelHTML</strong></a>(self, labelText<font color="#909090">=None</font>, for_value<font color="#909090">=None</font>)</dt></dl> <dl><dt><a name="HiddenInput-setCharset"><strong>setCharset</strong></a>(self, charset)</dt><dd><tt>Define the character set of the user's input.</tt></dd></dl> <dl><dt><a name="HiddenInput-setDefault"><strong>setDefault</strong></a>(self, default)</dt><dd><tt>Set the default of a field.<br> <br> Mainly this is used by the application if self.<strong>default</strong> shall<br> be changed after initializing the field object.</tt></dd></dl> <dl><dt><a name="HiddenInput-setRegex"><strong>setRegex</strong></a>(self, pattern)</dt><dd><tt>Set the regex pattern for validating this field.<br> <br> Mainly this is used if self.<strong>_re</strong> shall be changed after<br> the field object was initialized.<br> <br> pattern<br> Either a string containing a regex pattern,<br> a tuple (pattern string, pattern options) or None.<br> If None regex checking in _validateFormat is switched off<br> (not recommended).</tt></dd></dl> <dl><dt><a name="HiddenInput-setValue"><strong>setValue</strong></a>(self, value)</dt><dd><tt>Store the user's value into the field object.<br> <br> This method can be used to modify the user's value<br> before storing it into self.<strong>value</strong>.</tt></dd></dl> <dl><dt><a name="HiddenInput-valueHTML"><strong>valueHTML</strong></a>(self)</dt><dd><tt>HTML output of self.<strong>value</strong> using the HTML template string<br> in self.<strong>valueHTMLTemplate</strong>.</tt></dd></dl> </td></tr></table> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> <font color="#000000" face="helvetica, arial"><a name="Input">class <strong>Input</strong></a>(<a href="pyweblib.forms.html#Field">Field</a>)</font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> <td colspan=2><tt>Normal one-line input field:<br> <input><br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> <dl><dt><a name="Input-__init__"><strong>__init__</strong></a>(self, name, text, maxLen, maxValues, pattern, required<font color="#909090">=0</font>, default<font color="#909090">=None</font>, accessKey<font color="#909090">=''</font>, size<font color="#909090">=None</font>)</dt></dl> <dl><dt><a name="Input-inputHTML"><strong>inputHTML</strong></a>(self, default<font color="#909090">=None</font>, id_value<font color="#909090">=None</font>, title<font color="#909090">=None</font>)</dt></dl> <hr> Methods inherited from <a href="pyweblib.forms.html#Field">Field</a>:<br> <dl><dt><a name="Input-getValue"><strong>getValue</strong></a>(self)</dt><dd><tt>Returns self.<strong>value</strong> in case of multi-valued input or<br> self.<strong>value</strong>[0] if only one value is allowed.</tt></dd></dl> <dl><dt><a name="Input-idAttrStr"><strong>idAttrStr</strong></a>(self, id_value)</dt></dl> <dl><dt><a name="Input-labelHTML"><strong>labelHTML</strong></a>(self, labelText<font color="#909090">=None</font>, for_value<font color="#909090">=None</font>)</dt></dl> <dl><dt><a name="Input-setCharset"><strong>setCharset</strong></a>(self, charset)</dt><dd><tt>Define the character set of the user's input.</tt></dd></dl> <dl><dt><a name="Input-setDefault"><strong>setDefault</strong></a>(self, default)</dt><dd><tt>Set the default of a field.<br> <br> Mainly this is used by the application if self.<strong>default</strong> shall<br> be changed after initializing the field object.</tt></dd></dl> <dl><dt><a name="Input-setRegex"><strong>setRegex</strong></a>(self, pattern)</dt><dd><tt>Set the regex pattern for validating this field.<br> <br> Mainly this is used if self.<strong>_re</strong> shall be changed after<br> the field object was initialized.<br> <br> pattern<br> Either a string containing a regex pattern,<br> a tuple (pattern string, pattern options) or None.<br> If None regex checking in _validateFormat is switched off<br> (not recommended).</tt></dd></dl> <dl><dt><a name="Input-setValue"><strong>setValue</strong></a>(self, value)</dt><dd><tt>Store the user's value into the field object.<br> <br> This method can be used to modify the user's value<br> before storing it into self.<strong>value</strong>.</tt></dd></dl> <dl><dt><a name="Input-valueHTML"><strong>valueHTML</strong></a>(self)</dt><dd><tt>HTML output of self.<strong>value</strong> using the HTML template string<br> in self.<strong>valueHTMLTemplate</strong>.</tt></dd></dl> </td></tr></table> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> <font color="#000000" face="helvetica, arial"><a name="InvalidFormEncoding">class <strong>InvalidFormEncoding</strong></a>(<a href="pyweblib.forms.html#FormException">FormException</a>)</font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> <td colspan=2><tt>The form data is malformed.<br> <br> Attributes:<br> param name/value causing the exception<br> </tt></td></tr> <tr><td> </td> <td width="100%"><dl><dt>Method resolution order:</dt> <dd><a href="pyweblib.forms.html#InvalidFormEncoding">InvalidFormEncoding</a></dd> <dd><a href="pyweblib.forms.html#FormException">FormException</a></dd> <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="InvalidFormEncoding-__init__"><strong>__init__</strong></a>(self, param)</dt></dl> <dl><dt><a name="InvalidFormEncoding-__str__"><strong>__str__</strong></a>(self)</dt></dl> <hr> Methods inherited from <a href="pyweblib.forms.html#FormException">FormException</a>:<br> <dl><dt><a name="InvalidFormEncoding-html"><strong>html</strong></a>(self)</dt></dl> <hr> Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> <dl><dt><a name="InvalidFormEncoding-__getitem__"><strong>__getitem__</strong></a>(...)</dt></dl> </td></tr></table> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> <font color="#000000" face="helvetica, arial"><a name="InvalidRequestMethod">class <strong>InvalidRequestMethod</strong></a>(<a href="pyweblib.forms.html#FormException">FormException</a>)</font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> <td colspan=2><tt><a href="exceptions.html#Exception">Exception</a> raised when HTTP request method was invalid.<br> <br> Attributes:<br> method string containing method used<br> </tt></td></tr> <tr><td> </td> <td width="100%"><dl><dt>Method resolution order:</dt> <dd><a href="pyweblib.forms.html#InvalidRequestMethod">InvalidRequestMethod</a></dd> <dd><a href="pyweblib.forms.html#FormException">FormException</a></dd> <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="InvalidRequestMethod-__init__"><strong>__init__</strong></a>(self, method)</dt></dl> <dl><dt><a name="InvalidRequestMethod-__str__"><strong>__str__</strong></a>(self)</dt></dl> <hr> Methods inherited from <a href="pyweblib.forms.html#FormException">FormException</a>:<br> <dl><dt><a name="InvalidRequestMethod-html"><strong>html</strong></a>(self)</dt></dl> <hr> Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> <dl><dt><a name="InvalidRequestMethod-__getitem__"><strong>__getitem__</strong></a>(...)</dt></dl> </td></tr></table> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> <font color="#000000" face="helvetica, arial"><a name="InvalidValueFormat">class <strong>InvalidValueFormat</strong></a>(<a href="pyweblib.forms.html#FormException">FormException</a>)</font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> <td colspan=2><tt>The user's input does not match the required format.<br> <br> Attributes:<br> name name of input field (<a href="#Field">Field</a>.name)<br> text textual description of input field (<a href="#Field">Field</a>.text)<br> value input value received<br> </tt></td></tr> <tr><td> </td> <td width="100%"><dl><dt>Method resolution order:</dt> <dd><a href="pyweblib.forms.html#InvalidValueFormat">InvalidValueFormat</a></dd> <dd><a href="pyweblib.forms.html#FormException">FormException</a></dd> <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="InvalidValueFormat-__init__"><strong>__init__</strong></a>(self, name, text, value)</dt></dl> <dl><dt><a name="InvalidValueFormat-__str__"><strong>__str__</strong></a>(self)</dt></dl> <hr> Methods inherited from <a href="pyweblib.forms.html#FormException">FormException</a>:<br> <dl><dt><a name="InvalidValueFormat-html"><strong>html</strong></a>(self)</dt></dl> <hr> Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> <dl><dt><a name="InvalidValueFormat-__getitem__"><strong>__getitem__</strong></a>(...)</dt></dl> </td></tr></table> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> <font color="#000000" face="helvetica, arial"><a name="InvalidValueLen">class <strong>InvalidValueLen</strong></a>(<a href="pyweblib.forms.html#FormException">FormException</a>)</font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> <td colspan=2><tt>Length of user input value invalid.<br> <br> Attributes:<br> name name of input field (<a href="#Field">Field</a>.name)<br> text textual description of input field (<a href="#Field">Field</a>.text)<br> valueLen integer number of received value length<br> maxValueLen integer number of maximum value length<br> </tt></td></tr> <tr><td> </td> <td width="100%"><dl><dt>Method resolution order:</dt> <dd><a href="pyweblib.forms.html#InvalidValueLen">InvalidValueLen</a></dd> <dd><a href="pyweblib.forms.html#FormException">FormException</a></dd> <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="InvalidValueLen-__init__"><strong>__init__</strong></a>(self, name, text, valueLen, maxValueLen)</dt></dl> <dl><dt><a name="InvalidValueLen-__str__"><strong>__str__</strong></a>(self)</dt></dl> <hr> Methods inherited from <a href="pyweblib.forms.html#FormException">FormException</a>:<br> <dl><dt><a name="InvalidValueLen-html"><strong>html</strong></a>(self)</dt></dl> <hr> Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> <dl><dt><a name="InvalidValueLen-__getitem__"><strong>__getitem__</strong></a>(...)</dt></dl> </td></tr></table> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> <font color="#000000" face="helvetica, arial"><a name="Keygen">class <strong>Keygen</strong></a>(<a href="pyweblib.forms.html#Field">Field</a>)</font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> <td colspan=2><tt><a href="#Select">Select</a> field for client-side key generation with<br> Netscape/Mozilla/Opera browser:<br> <KEYGEN><br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> <dl><dt><a name="Keygen-__init__"><strong>__init__</strong></a>(self, name, text, maxLen, maxValues, required<font color="#909090">=0</font>, minKeyLength<font color="#909090">=512</font>)</dt></dl> <dl><dt><a name="Keygen-inputHTML"><strong>inputHTML</strong></a>(self, challenge, id_value<font color="#909090">=None</font>, title<font color="#909090">=None</font>)</dt></dl> <dl><dt><a name="Keygen-valueHTML"><strong>valueHTML</strong></a>(self)</dt></dl> <hr> Methods inherited from <a href="pyweblib.forms.html#Field">Field</a>:<br> <dl><dt><a name="Keygen-getValue"><strong>getValue</strong></a>(self)</dt><dd><tt>Returns self.<strong>value</strong> in case of multi-valued input or<br> self.<strong>value</strong>[0] if only one value is allowed.</tt></dd></dl> <dl><dt><a name="Keygen-idAttrStr"><strong>idAttrStr</strong></a>(self, id_value)</dt></dl> <dl><dt><a name="Keygen-labelHTML"><strong>labelHTML</strong></a>(self, labelText<font color="#909090">=None</font>, for_value<font color="#909090">=None</font>)</dt></dl> <dl><dt><a name="Keygen-setCharset"><strong>setCharset</strong></a>(self, charset)</dt><dd><tt>Define the character set of the user's input.</tt></dd></dl> <dl><dt><a name="Keygen-setDefault"><strong>setDefault</strong></a>(self, default)</dt><dd><tt>Set the default of a field.<br> <br> Mainly this is used by the application if self.<strong>default</strong> shall<br> be changed after initializing the field object.</tt></dd></dl> <dl><dt><a name="Keygen-setRegex"><strong>setRegex</strong></a>(self, pattern)</dt><dd><tt>Set the regex pattern for validating this field.<br> <br> Mainly this is used if self.<strong>_re</strong> shall be changed after<br> the field object was initialized.<br> <br> pattern<br> Either a string containing a regex pattern,<br> a tuple (pattern string, pattern options) or None.<br> If None regex checking in _validateFormat is switched off<br> (not recommended).</tt></dd></dl> <dl><dt><a name="Keygen-setValue"><strong>setValue</strong></a>(self, value)</dt><dd><tt>Store the user's value into the field object.<br> <br> This method can be used to modify the user's value<br> before storing it into self.<strong>value</strong>.</tt></dd></dl> </td></tr></table> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> <font color="#000000" face="helvetica, arial"><a name="ParamsMissing">class <strong>ParamsMissing</strong></a>(<a href="pyweblib.forms.html#FormException">FormException</a>)</font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> <td colspan=2><tt>Required parameters are missing.<br> <br> Attributes:<br> missingParamNames list of strings containing all names of missing<br> input fields.<br> </tt></td></tr> <tr><td> </td> <td width="100%"><dl><dt>Method resolution order:</dt> <dd><a href="pyweblib.forms.html#ParamsMissing">ParamsMissing</a></dd> <dd><a href="pyweblib.forms.html#FormException">FormException</a></dd> <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="ParamsMissing-__init__"><strong>__init__</strong></a>(self, missingParamNames)</dt></dl> <dl><dt><a name="ParamsMissing-__str__"><strong>__str__</strong></a>(self)</dt></dl> <hr> Methods inherited from <a href="pyweblib.forms.html#FormException">FormException</a>:<br> <dl><dt><a name="ParamsMissing-html"><strong>html</strong></a>(self)</dt></dl> <hr> Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> <dl><dt><a name="ParamsMissing-__getitem__"><strong>__getitem__</strong></a>(...)</dt></dl> </td></tr></table> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> <font color="#000000" face="helvetica, arial"><a name="Password">class <strong>Password</strong></a>(<a href="pyweblib.forms.html#Input">Input</a>)</font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> <td colspan=2><tt><a href="#Password">Password</a> input field:<br> <input type=password><br> </tt></td></tr> <tr><td> </td> <td width="100%"><dl><dt>Method resolution order:</dt> <dd><a href="pyweblib.forms.html#Password">Password</a></dd> <dd><a href="pyweblib.forms.html#Input">Input</a></dd> <dd><a href="pyweblib.forms.html#Field">Field</a></dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="Password-inputHTML"><strong>inputHTML</strong></a>(self, default<font color="#909090">=None</font>, id_value<font color="#909090">=None</font>, title<font color="#909090">=None</font>)</dt></dl> <dl><dt><a name="Password-valueHTML"><strong>valueHTML</strong></a>(self)</dt><dd><tt>For security reasons only stars are printed</tt></dd></dl> <hr> Methods inherited from <a href="pyweblib.forms.html#Input">Input</a>:<br> <dl><dt><a name="Password-__init__"><strong>__init__</strong></a>(self, name, text, maxLen, maxValues, pattern, required<font color="#909090">=0</font>, default<font color="#909090">=None</font>, accessKey<font color="#909090">=''</font>, size<font color="#909090">=None</font>)</dt></dl> <hr> Methods inherited from <a href="pyweblib.forms.html#Field">Field</a>:<br> <dl><dt><a name="Password-getValue"><strong>getValue</strong></a>(self)</dt><dd><tt>Returns self.<strong>value</strong> in case of multi-valued input or<br> self.<strong>value</strong>[0] if only one value is allowed.</tt></dd></dl> <dl><dt><a name="Password-idAttrStr"><strong>idAttrStr</strong></a>(self, id_value)</dt></dl> <dl><dt><a name="Password-labelHTML"><strong>labelHTML</strong></a>(self, labelText<font color="#909090">=None</font>, for_value<font color="#909090">=None</font>)</dt></dl> <dl><dt><a name="Password-setCharset"><strong>setCharset</strong></a>(self, charset)</dt><dd><tt>Define the character set of the user's input.</tt></dd></dl> <dl><dt><a name="Password-setDefault"><strong>setDefault</strong></a>(self, default)</dt><dd><tt>Set the default of a field.<br> <br> Mainly this is used by the application if self.<strong>default</strong> shall<br> be changed after initializing the field object.</tt></dd></dl> <dl><dt><a name="Password-setRegex"><strong>setRegex</strong></a>(self, pattern)</dt><dd><tt>Set the regex pattern for validating this field.<br> <br> Mainly this is used if self.<strong>_re</strong> shall be changed after<br> the field object was initialized.<br> <br> pattern<br> Either a string containing a regex pattern,<br> a tuple (pattern string, pattern options) or None.<br> If None regex checking in _validateFormat is switched off<br> (not recommended).</tt></dd></dl> <dl><dt><a name="Password-setValue"><strong>setValue</strong></a>(self, value)</dt><dd><tt>Store the user's value into the field object.<br> <br> This method can be used to modify the user's value<br> before storing it into self.<strong>value</strong>.</tt></dd></dl> </td></tr></table> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> <font color="#000000" face="helvetica, arial"><a name="Radio">class <strong>Radio</strong></a>(<a href="pyweblib.forms.html#Field">Field</a>)</font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> <td colspan=2><tt><a href="#Radio">Radio</a> buttons:<br> <INPUT TYPE=RADIO><br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> <dl><dt><a name="Radio-__init__"><strong>__init__</strong></a>(self, name, text, maxValues<font color="#909090">=1</font>, required<font color="#909090">=0</font>, default<font color="#909090">=None</font>, accessKey<font color="#909090">=''</font>, options<font color="#909090">=None</font>)</dt><dd><tt>pattern and maxLen are determined from __init__ params<br> Additional parameters:<br> options=[]<br> List of options. Either just a list of strings<br> ['value1','value2',..] for simple options<br> or a list of tuples of string pairs<br> [('value1','description1),('value2','description2),..]<br> for options with different option value and description.</tt></dd></dl> <dl><dt><a name="Radio-inputHTML"><strong>inputHTML</strong></a>(self, default<font color="#909090">=None</font>, id_value<font color="#909090">=None</font>, title<font color="#909090">=None</font>)</dt></dl> <dl><dt><a name="Radio-setDefault"><strong>setDefault</strong></a>(self, default)</dt><dd><tt>Set the default of a default field.<br> <br> Mainly this is used if self.<strong>default</strong> shall be changed after<br> initializing the field object.</tt></dd></dl> <dl><dt><a name="Radio-setOptions"><strong>setOptions</strong></a>(self, options)</dt></dl> <hr> Methods inherited from <a href="pyweblib.forms.html#Field">Field</a>:<br> <dl><dt><a name="Radio-getValue"><strong>getValue</strong></a>(self)</dt><dd><tt>Returns self.<strong>value</strong> in case of multi-valued input or<br> self.<strong>value</strong>[0] if only one value is allowed.</tt></dd></dl> <dl><dt><a name="Radio-idAttrStr"><strong>idAttrStr</strong></a>(self, id_value)</dt></dl> <dl><dt><a name="Radio-labelHTML"><strong>labelHTML</strong></a>(self, labelText<font color="#909090">=None</font>, for_value<font color="#909090">=None</font>)</dt></dl> <dl><dt><a name="Radio-setCharset"><strong>setCharset</strong></a>(self, charset)</dt><dd><tt>Define the character set of the user's input.</tt></dd></dl> <dl><dt><a name="Radio-setRegex"><strong>setRegex</strong></a>(self, pattern)</dt><dd><tt>Set the regex pattern for validating this field.<br> <br> Mainly this is used if self.<strong>_re</strong> shall be changed after<br> the field object was initialized.<br> <br> pattern<br> Either a string containing a regex pattern,<br> a tuple (pattern string, pattern options) or None.<br> If None regex checking in _validateFormat is switched off<br> (not recommended).</tt></dd></dl> <dl><dt><a name="Radio-setValue"><strong>setValue</strong></a>(self, value)</dt><dd><tt>Store the user's value into the field object.<br> <br> This method can be used to modify the user's value<br> before storing it into self.<strong>value</strong>.</tt></dd></dl> <dl><dt><a name="Radio-valueHTML"><strong>valueHTML</strong></a>(self)</dt><dd><tt>HTML output of self.<strong>value</strong> using the HTML template string<br> in self.<strong>valueHTMLTemplate</strong>.</tt></dd></dl> </td></tr></table> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> <font color="#000000" face="helvetica, arial"><a name="Select">class <strong>Select</strong></a>(<a href="pyweblib.forms.html#Radio">Radio</a>)</font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> <td colspan=2><tt><a href="#Select">Select</a> field:<br> <select multiple><br> <option value="value">description</option><br> </select><br> </tt></td></tr> <tr><td> </td> <td width="100%"><dl><dt>Method resolution order:</dt> <dd><a href="pyweblib.forms.html#Select">Select</a></dd> <dd><a href="pyweblib.forms.html#Radio">Radio</a></dd> <dd><a href="pyweblib.forms.html#Field">Field</a></dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="Select-__init__"><strong>__init__</strong></a>(self, name, text, maxValues, required<font color="#909090">=0</font>, default<font color="#909090">=None</font>, accessKey<font color="#909090">=''</font>, options<font color="#909090">=None</font>, size<font color="#909090">=1</font>, ignoreCase<font color="#909090">=0</font>, multiSelect<font color="#909090">=0</font>)</dt><dd><tt>Additional parameters:<br> size<br> Integer for the size of displayed select field.<br> ignorecase<br> Integer flag. If non-zero the case of input strings is ignored<br> when checking input values.<br> multiSelect<br> Integer flag. If non-zero the select field has HTML attribute<br> "multiple" set.</tt></dd></dl> <dl><dt><a name="Select-inputHTML"><strong>inputHTML</strong></a>(self, default<font color="#909090">=None</font>, id_value<font color="#909090">=None</font>, title<font color="#909090">=None</font>)</dt></dl> <hr> Methods inherited from <a href="pyweblib.forms.html#Radio">Radio</a>:<br> <dl><dt><a name="Select-setDefault"><strong>setDefault</strong></a>(self, default)</dt><dd><tt>Set the default of a default field.<br> <br> Mainly this is used if self.<strong>default</strong> shall be changed after<br> initializing the field object.</tt></dd></dl> <dl><dt><a name="Select-setOptions"><strong>setOptions</strong></a>(self, options)</dt></dl> <hr> Methods inherited from <a href="pyweblib.forms.html#Field">Field</a>:<br> <dl><dt><a name="Select-getValue"><strong>getValue</strong></a>(self)</dt><dd><tt>Returns self.<strong>value</strong> in case of multi-valued input or<br> self.<strong>value</strong>[0] if only one value is allowed.</tt></dd></dl> <dl><dt><a name="Select-idAttrStr"><strong>idAttrStr</strong></a>(self, id_value)</dt></dl> <dl><dt><a name="Select-labelHTML"><strong>labelHTML</strong></a>(self, labelText<font color="#909090">=None</font>, for_value<font color="#909090">=None</font>)</dt></dl> <dl><dt><a name="Select-setCharset"><strong>setCharset</strong></a>(self, charset)</dt><dd><tt>Define the character set of the user's input.</tt></dd></dl> <dl><dt><a name="Select-setRegex"><strong>setRegex</strong></a>(self, pattern)</dt><dd><tt>Set the regex pattern for validating this field.<br> <br> Mainly this is used if self.<strong>_re</strong> shall be changed after<br> the field object was initialized.<br> <br> pattern<br> Either a string containing a regex pattern,<br> a tuple (pattern string, pattern options) or None.<br> If None regex checking in _validateFormat is switched off<br> (not recommended).</tt></dd></dl> <dl><dt><a name="Select-setValue"><strong>setValue</strong></a>(self, value)</dt><dd><tt>Store the user's value into the field object.<br> <br> This method can be used to modify the user's value<br> before storing it into self.<strong>value</strong>.</tt></dd></dl> <dl><dt><a name="Select-valueHTML"><strong>valueHTML</strong></a>(self)</dt><dd><tt>HTML output of self.<strong>value</strong> using the HTML template string<br> in self.<strong>valueHTMLTemplate</strong>.</tt></dd></dl> </td></tr></table> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> <font color="#000000" face="helvetica, arial"><a name="Textarea">class <strong>Textarea</strong></a>(<a href="pyweblib.forms.html#Field">Field</a>)</font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> <td colspan=2><tt>Multi-line input field:<br> <textarea><br> </tt></td></tr> <tr><td> </td> <td width="100%">Methods defined here:<br> <dl><dt><a name="Textarea-__init__"><strong>__init__</strong></a>(self, name, text, maxLen, maxValues, pattern, required<font color="#909090">=0</font>, default<font color="#909090">=None</font>, accessKey<font color="#909090">=''</font>, rows<font color="#909090">=10</font>, cols<font color="#909090">=60</font>)</dt></dl> <dl><dt><a name="Textarea-inputHTML"><strong>inputHTML</strong></a>(self, default<font color="#909090">=None</font>, id_value<font color="#909090">=None</font>, title<font color="#909090">=None</font>)</dt><dd><tt>Returns string with HTML input field.</tt></dd></dl> <dl><dt><a name="Textarea-setRegex"><strong>setRegex</strong></a>(self, pattern)</dt><dd><tt>Like <a href="#Field">Field</a>.<a href="#Textarea-setRegex">setRegex</a>() but pattern options re.S and re.M are<br> automatically added.</tt></dd></dl> <dl><dt><a name="Textarea-valueHTML"><strong>valueHTML</strong></a>(self)</dt><dd><tt>HTML output of self.<strong>value</strong> using the HTML template string<br> in self.<strong>valueHTMLTemplate</strong>.</tt></dd></dl> <hr> Methods inherited from <a href="pyweblib.forms.html#Field">Field</a>:<br> <dl><dt><a name="Textarea-getValue"><strong>getValue</strong></a>(self)</dt><dd><tt>Returns self.<strong>value</strong> in case of multi-valued input or<br> self.<strong>value</strong>[0] if only one value is allowed.</tt></dd></dl> <dl><dt><a name="Textarea-idAttrStr"><strong>idAttrStr</strong></a>(self, id_value)</dt></dl> <dl><dt><a name="Textarea-labelHTML"><strong>labelHTML</strong></a>(self, labelText<font color="#909090">=None</font>, for_value<font color="#909090">=None</font>)</dt></dl> <dl><dt><a name="Textarea-setCharset"><strong>setCharset</strong></a>(self, charset)</dt><dd><tt>Define the character set of the user's input.</tt></dd></dl> <dl><dt><a name="Textarea-setDefault"><strong>setDefault</strong></a>(self, default)</dt><dd><tt>Set the default of a field.<br> <br> Mainly this is used by the application if self.<strong>default</strong> shall<br> be changed after initializing the field object.</tt></dd></dl> <dl><dt><a name="Textarea-setValue"><strong>setValue</strong></a>(self, value)</dt><dd><tt>Store the user's value into the field object.<br> <br> This method can be used to modify the user's value<br> before storing it into self.<strong>value</strong>.</tt></dd></dl> </td></tr></table> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> <font color="#000000" face="helvetica, arial"><a name="TooManyValues">class <strong>TooManyValues</strong></a>(<a href="pyweblib.forms.html#FormException">FormException</a>)</font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> <td colspan=2><tt>User's input contained too many values for same parameter.<br> <br> Attributes:<br> name name of input field (<a href="#Field">Field</a>.name)<br> text textual description of input field (<a href="#Field">Field</a>.text)<br> valueCount integer number of values counted with name<br> maxValueCount integer number of maximum values with name allowed<br> </tt></td></tr> <tr><td> </td> <td width="100%"><dl><dt>Method resolution order:</dt> <dd><a href="pyweblib.forms.html#TooManyValues">TooManyValues</a></dd> <dd><a href="pyweblib.forms.html#FormException">FormException</a></dd> <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="TooManyValues-__init__"><strong>__init__</strong></a>(self, name, text, valueCount, maxValueCount)</dt></dl> <dl><dt><a name="TooManyValues-__str__"><strong>__str__</strong></a>(self)</dt></dl> <hr> Methods inherited from <a href="pyweblib.forms.html#FormException">FormException</a>:<br> <dl><dt><a name="TooManyValues-html"><strong>html</strong></a>(self)</dt></dl> <hr> Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> <dl><dt><a name="TooManyValues-__getitem__"><strong>__getitem__</strong></a>(...)</dt></dl> </td></tr></table> <p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#ffc8d8"> <td colspan=3 valign=bottom> <br> <font color="#000000" face="helvetica, arial"><a name="UndeclaredFieldName">class <strong>UndeclaredFieldName</strong></a>(<a href="pyweblib.forms.html#FormException">FormException</a>)</font></td></tr> <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> <td colspan=2><tt>Parameter with undeclared name attribute received.<br> <br> Attributes:<br> name name of undeclared field<br> </tt></td></tr> <tr><td> </td> <td width="100%"><dl><dt>Method resolution order:</dt> <dd><a href="pyweblib.forms.html#UndeclaredFieldName">UndeclaredFieldName</a></dd> <dd><a href="pyweblib.forms.html#FormException">FormException</a></dd> <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> </dl> <hr> Methods defined here:<br> <dl><dt><a name="UndeclaredFieldName-__init__"><strong>__init__</strong></a>(self, name)</dt></dl> <dl><dt><a name="UndeclaredFieldName-__str__"><strong>__str__</strong></a>(self)</dt></dl> <hr> Methods inherited from <a href="pyweblib.forms.html#FormException">FormException</a>:<br> <dl><dt><a name="UndeclaredFieldName-html"><strong>html</strong></a>(self)</dt></dl> <hr> Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> <dl><dt><a name="UndeclaredFieldName-__getitem__"><strong>__getitem__</strong></a>(...)</dt></dl> </td></tr></table></td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#eeaa77"> <td colspan=3 valign=bottom> <br> <font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr> <tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td> <td width="100%"><dl><dt><a name="-escapeHTML"><strong>escapeHTML</strong></a>(s)</dt><dd><tt>Escape all characters with a special meaning in HTML<br> to appropriate character tags</tt></dd></dl> </td></tr></table><p> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> <tr bgcolor="#55aa55"> <td colspan=3 valign=bottom> <br> <font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr> <tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td> <td width="100%"><strong>__version__</strong> = '0.15.0'</td></tr></table> </body></html>