| |
- exceptions.Exception
-
- FormException
-
- ContentLengthExceeded
- InvalidFormEncoding
- InvalidRequestMethod
- InvalidValueFormat
- InvalidValueLen
- ParamsMissing
- TooManyValues
- UndeclaredFieldName
- Field
-
- Checkbox
- Input
-
- HiddenInput
- Password
- Keygen
- Radio
-
- Select
- Textarea
- Form
class Checkbox(Field) |
|
Check boxes:
<INPUT TYPE=CHECKBOX> |
|
Methods defined here:
- __init__(self, name, text, maxValues=1, required=0, accessKey='', default=None, checked=0)
- pattern and maxLen are determined by default
- inputHTML(self, default=None)
Data and non-method functions defined here:
- __doc__ = '\n Check boxes:\n <INPUT TYPE=CHECKBOX>\n '
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- __module__ = 'pyweblib.forms'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Methods inherited from Field:
- _accessKeyAttr(self)
- _defaultHTML(self, default)
- HTML output of default.
- _defaultValue(self, default)
- HTML output of default.
- _encodeValue(self, value)
- Return Unicode object or string to be stored in self.value
- _patternAndOptions(self, pattern)
- The result is a tuple (pattern string,pattern options).
pattern
Either a string containing a regex pattern,
a tuple (pattern string, pattern options) or None.
- _validateFormat(self, value)
- Check format of the user's value for this field.
Empty input (zero-length string) are valid in any case.
You might override this method to change this behaviour.
- _validateLen(self, value)
- Check length of the user's value for this field.
- _validateMaxValue(self)
- getValue(self)
- Returns self.value in case of multi-valued input or
self.value[0] if only one value is allowed.
- labelHTML(self, labelText=None)
- setCharset(self, charset)
- Define the character set of the user's input.
- setDefault(self, default)
- Set the default of a field.
Mainly this is used by the application if self.default shall
be changed after initializing the field object.
- setRegex(self, pattern)
- Set the regex pattern for validating this field.
Mainly this is used if self._re shall be changed after
the field object was initialized.
pattern
Either a string containing a regex pattern,
a tuple (pattern string, pattern options) or None.
If None regex checking in _validateFormat is switched off
(not recommended).
- setValue(self, value)
- Store the user's value into the field object.
This method can be used to modify the user's value
before storing it into self.value.
- valueHTML(self)
- HTML output of self.value using the HTML template string
in self.valueHTMLTemplate.
|
class ContentLengthExceeded(FormException) |
|
Overall length of input data too large.
Attributes:
contentLength received content length
maxContentLength maximum valid content length |
|
- Method resolution order:
- ContentLengthExceeded
- FormException
- exceptions.Exception
Methods defined here:
- __init__(self, contentLength, maxContentLength)
- __str__(self)
Data and non-method functions defined here:
- __doc__ = '\n Overall length of input data too large.\n\n At...ontentLength maximum valid content length\n '
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- __module__ = 'pyweblib.forms'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Methods inherited from FormException:
- html(self)
Methods inherited from exceptions.Exception:
- __getitem__(...)
|
class Field |
|
Base class for all kind of single input fields.
In most cases this class is not used directly
since derivate classes for most types of input fields exist. |
|
Methods defined here:
- __init__(self, name, text, maxLen, maxValues, pattern, required=0, default=None, accessKey='')
- name
Field name used in <INPUT NAME="..">
text
User-friendly text describing this field
maxLen
maximum length of a single input value [Bytes]
maxValues
maximum amount of input values
default
default value to be used in method inputfield()
required
flag which marks field as mandantory input field
accessKey
key for accessing this field to be displayed by method inputHTML()
pattern
regex pattern of valid values either as string
or tuple (pattern,options)
- _accessKeyAttr(self)
- _defaultHTML(self, default)
- HTML output of default.
- _defaultValue(self, default)
- HTML output of default.
- _encodeValue(self, value)
- Return Unicode object or string to be stored in self.value
- _patternAndOptions(self, pattern)
- The result is a tuple (pattern string,pattern options).
pattern
Either a string containing a regex pattern,
a tuple (pattern string, pattern options) or None.
- _validateFormat(self, value)
- Check format of the user's value for this field.
Empty input (zero-length string) are valid in any case.
You might override this method to change this behaviour.
- _validateLen(self, value)
- Check length of the user's value for this field.
- _validateMaxValue(self)
- getValue(self)
- Returns self.value in case of multi-valued input or
self.value[0] if only one value is allowed.
- labelHTML(self, labelText=None)
- setCharset(self, charset)
- Define the character set of the user's input.
- setDefault(self, default)
- Set the default of a field.
Mainly this is used by the application if self.default shall
be changed after initializing the field object.
- setRegex(self, pattern)
- Set the regex pattern for validating this field.
Mainly this is used if self._re shall be changed after
the field object was initialized.
pattern
Either a string containing a regex pattern,
a tuple (pattern string, pattern options) or None.
If None regex checking in _validateFormat is switched off
(not recommended).
- setValue(self, value)
- Store the user's value into the field object.
This method can be used to modify the user's value
before storing it into self.value.
- valueHTML(self)
- HTML output of self.value using the HTML template string
in self.valueHTMLTemplate.
Data and non-method functions defined here:
- __doc__ = '\n Base class for all kind of single input field... classes for most types of input fields exist.\n '
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- __module__ = 'pyweblib.forms'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
|
class Form |
|
Class for declaring and processing a whole <form> |
|
Methods defined here:
- __init__(self, inf=None, env=None)
- Initialize a Form
inf Read from this file object if method is POST.
env Dictionary holding the environment vars.
- addField(self, f)
- Add a input field object f to the form.
- getInputFields(self, ignoreEmptyFields=0, ignoreUndeclaredFields=0, stripValues=1)
- Process user's <form> input and store the values in each
field instance's content attribute.
When a processing error occurs FormException (or derivatives)
are raised.
ignoreEmptyFields=0 Ignore fields with empty input.
ignoreUndeclaredFields=0, Ignore fields with names not declared.
Normally UndeclaredFieldName is raised.
stripValues=1, If true leading and trailing whitespaces
are stripped from all input values.
- getInputValue(self, name, default=[])
- Return input value of a field defined by name if presented
in form input. Return default else.
- hiddenInputFields(self, outf=<open file '<stdout>', mode 'w'>, ignoreFieldNames=[])
- Output all parameters as hidden fields.
outf
File object for output.
ignoreFieldNames
Names of parameters to be excluded.
Data and non-method functions defined here:
- __doc__ = '\n Class for declaring and processing a whole <form>\n '
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- __module__ = 'pyweblib.forms'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
|
class FormException(exceptions.Exception) |
|
Base exception class to indicate form processing errors.
Attributes:
args unstructured List of parameters |
|
Methods defined here:
- __init__(self, *args, **kwargs)
- html(self)
Data and non-method functions defined here:
- __doc__ = '\n Base exception class to indicate form process... args unstructured List of parameters\n '
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- __module__ = 'pyweblib.forms'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Methods inherited from exceptions.Exception:
- __getitem__(...)
- __str__(...)
|
class HiddenInput(Input) |
|
Hidden input field:
<input type="hidden"> |
|
- Method resolution order:
- HiddenInput
- Input
- Field
Methods defined here:
- __init__(self, name, text, maxLen, maxValues, pattern, required=0, default=None, show=0)
- inputHTML(self, default=None)
Data and non-method functions defined here:
- __doc__ = '\n Hidden input field:\n <input type="hidden">\n '
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- __module__ = 'pyweblib.forms'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Methods inherited from Field:
- _accessKeyAttr(self)
- _defaultHTML(self, default)
- HTML output of default.
- _defaultValue(self, default)
- HTML output of default.
- _encodeValue(self, value)
- Return Unicode object or string to be stored in self.value
- _patternAndOptions(self, pattern)
- The result is a tuple (pattern string,pattern options).
pattern
Either a string containing a regex pattern,
a tuple (pattern string, pattern options) or None.
- _validateFormat(self, value)
- Check format of the user's value for this field.
Empty input (zero-length string) are valid in any case.
You might override this method to change this behaviour.
- _validateLen(self, value)
- Check length of the user's value for this field.
- _validateMaxValue(self)
- getValue(self)
- Returns self.value in case of multi-valued input or
self.value[0] if only one value is allowed.
- labelHTML(self, labelText=None)
- setCharset(self, charset)
- Define the character set of the user's input.
- setDefault(self, default)
- Set the default of a field.
Mainly this is used by the application if self.default shall
be changed after initializing the field object.
- setRegex(self, pattern)
- Set the regex pattern for validating this field.
Mainly this is used if self._re shall be changed after
the field object was initialized.
pattern
Either a string containing a regex pattern,
a tuple (pattern string, pattern options) or None.
If None regex checking in _validateFormat is switched off
(not recommended).
- setValue(self, value)
- Store the user's value into the field object.
This method can be used to modify the user's value
before storing it into self.value.
- valueHTML(self)
- HTML output of self.value using the HTML template string
in self.valueHTMLTemplate.
|
class Input(Field) |
|
Normal one-line input field:
<input> |
|
Methods defined here:
- __init__(self, name, text, maxLen, maxValues, pattern, required=0, default=None, accessKey='', size=None)
- inputHTML(self, default=None)
Data and non-method functions defined here:
- __doc__ = '\n Normal one-line input field:\n <input>\n '
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- __module__ = 'pyweblib.forms'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Methods inherited from Field:
- _accessKeyAttr(self)
- _defaultHTML(self, default)
- HTML output of default.
- _defaultValue(self, default)
- HTML output of default.
- _encodeValue(self, value)
- Return Unicode object or string to be stored in self.value
- _patternAndOptions(self, pattern)
- The result is a tuple (pattern string,pattern options).
pattern
Either a string containing a regex pattern,
a tuple (pattern string, pattern options) or None.
- _validateFormat(self, value)
- Check format of the user's value for this field.
Empty input (zero-length string) are valid in any case.
You might override this method to change this behaviour.
- _validateLen(self, value)
- Check length of the user's value for this field.
- _validateMaxValue(self)
- getValue(self)
- Returns self.value in case of multi-valued input or
self.value[0] if only one value is allowed.
- labelHTML(self, labelText=None)
- setCharset(self, charset)
- Define the character set of the user's input.
- setDefault(self, default)
- Set the default of a field.
Mainly this is used by the application if self.default shall
be changed after initializing the field object.
- setRegex(self, pattern)
- Set the regex pattern for validating this field.
Mainly this is used if self._re shall be changed after
the field object was initialized.
pattern
Either a string containing a regex pattern,
a tuple (pattern string, pattern options) or None.
If None regex checking in _validateFormat is switched off
(not recommended).
- setValue(self, value)
- Store the user's value into the field object.
This method can be used to modify the user's value
before storing it into self.value.
- valueHTML(self)
- HTML output of self.value using the HTML template string
in self.valueHTMLTemplate.
|
class InvalidFormEncoding(FormException) |
|
The form data is malformed.
Attributes:
param name/value causing the exception |
|
- Method resolution order:
- InvalidFormEncoding
- FormException
- exceptions.Exception
Methods defined here:
- __init__(self, param)
- __str__(self)
Data and non-method functions defined here:
- __doc__ = '\n The form data is malformed.\n \n Attributes:\n param name/value causing the exception\n '
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- __module__ = 'pyweblib.forms'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Methods inherited from FormException:
- html(self)
Methods inherited from exceptions.Exception:
- __getitem__(...)
|
class InvalidRequestMethod(FormException) |
|
Exception raised when HTTP request method was invalid.
Attributes:
method string containing method used |
|
- Method resolution order:
- InvalidRequestMethod
- FormException
- exceptions.Exception
Methods defined here:
- __init__(self, method)
- __str__(self)
Data and non-method functions defined here:
- __doc__ = '\n Exception raised when HTTP request method was...\n method string containing method used\n '
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- __module__ = 'pyweblib.forms'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Methods inherited from FormException:
- html(self)
Methods inherited from exceptions.Exception:
- __getitem__(...)
|
class InvalidValueFormat(FormException) |
|
The user's input does not match the required format.
Attributes:
name name of input field (Field.name)
text textual description of input field (Field.text)
value input value received |
|
- Method resolution order:
- InvalidValueFormat
- FormException
- exceptions.Exception
Methods defined here:
- __init__(self, name, text, value)
- __str__(self)
Data and non-method functions defined here:
- __doc__ = "\n The user's input does not match the required ...eld.text)\n value input value received\n "
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- __module__ = 'pyweblib.forms'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Methods inherited from FormException:
- html(self)
Methods inherited from exceptions.Exception:
- __getitem__(...)
|
class InvalidValueLen(FormException) |
|
Length of user input value invalid.
Attributes:
name name of input field (Field.name)
text textual description of input field (Field.text)
valueLen integer number of received value length
maxValueLen integer number of maximum value length |
|
- Method resolution order:
- InvalidValueLen
- FormException
- exceptions.Exception
Methods defined here:
- __init__(self, name, text, valueLen, maxValueLen)
- __str__(self)
Data and non-method functions defined here:
- __doc__ = '\n Length of user input value invalid.\n\n Attrib...ueLen integer number of maximum value length\n '
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- __module__ = 'pyweblib.forms'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Methods inherited from FormException:
- html(self)
Methods inherited from exceptions.Exception:
- __getitem__(...)
|
class Keygen(Field) |
|
Select field for client-side key generation with
Netscape/Mozilla/Opera browser:
<KEYGEN> |
|
Methods defined here:
- __init__(self, name, text, maxLen, maxValues, required=0, minKeyLength=512)
- _encodeValue(self, value)
- inputHTML(self, challenge)
- valueHTML(self)
Data and non-method functions defined here:
- __doc__ = '\n Select field for client-side key generation with\n Netscape/Mozilla/Opera browser:\n <KEYGEN>\n '
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- __module__ = 'pyweblib.forms'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Methods inherited from Field:
- _accessKeyAttr(self)
- _defaultHTML(self, default)
- HTML output of default.
- _defaultValue(self, default)
- HTML output of default.
- _patternAndOptions(self, pattern)
- The result is a tuple (pattern string,pattern options).
pattern
Either a string containing a regex pattern,
a tuple (pattern string, pattern options) or None.
- _validateFormat(self, value)
- Check format of the user's value for this field.
Empty input (zero-length string) are valid in any case.
You might override this method to change this behaviour.
- _validateLen(self, value)
- Check length of the user's value for this field.
- _validateMaxValue(self)
- getValue(self)
- Returns self.value in case of multi-valued input or
self.value[0] if only one value is allowed.
- labelHTML(self, labelText=None)
- setCharset(self, charset)
- Define the character set of the user's input.
- setDefault(self, default)
- Set the default of a field.
Mainly this is used by the application if self.default shall
be changed after initializing the field object.
- setRegex(self, pattern)
- Set the regex pattern for validating this field.
Mainly this is used if self._re shall be changed after
the field object was initialized.
pattern
Either a string containing a regex pattern,
a tuple (pattern string, pattern options) or None.
If None regex checking in _validateFormat is switched off
(not recommended).
- setValue(self, value)
- Store the user's value into the field object.
This method can be used to modify the user's value
before storing it into self.value.
|
class ParamsMissing(FormException) |
|
Required parameters are missing.
Attributes:
missingParamNames list of strings containing all names of missing
input fields. |
|
- Method resolution order:
- ParamsMissing
- FormException
- exceptions.Exception
Methods defined here:
- __init__(self, missingParamNames)
- __str__(self)
Data and non-method functions defined here:
- __doc__ = '\n Required parameters are missing.\n\n Attribute... missing\n input fields.\n '
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- __module__ = 'pyweblib.forms'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Methods inherited from FormException:
- html(self)
Methods inherited from exceptions.Exception:
- __getitem__(...)
|
class Password(Input) |
|
Password input field:
<input type=password> |
|
- Method resolution order:
- Password
- Input
- Field
Methods defined here:
- inputHTML(self)
- valueHTML(self)
- For security reasons only stars are printed
Data and non-method functions defined here:
- __doc__ = '\n Password input field:\n <input type=password>\n '
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- __module__ = 'pyweblib.forms'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Methods inherited from Input:
- __init__(self, name, text, maxLen, maxValues, pattern, required=0, default=None, accessKey='', size=None)
Methods inherited from Field:
- _accessKeyAttr(self)
- _defaultHTML(self, default)
- HTML output of default.
- _defaultValue(self, default)
- HTML output of default.
- _encodeValue(self, value)
- Return Unicode object or string to be stored in self.value
- _patternAndOptions(self, pattern)
- The result is a tuple (pattern string,pattern options).
pattern
Either a string containing a regex pattern,
a tuple (pattern string, pattern options) or None.
- _validateFormat(self, value)
- Check format of the user's value for this field.
Empty input (zero-length string) are valid in any case.
You might override this method to change this behaviour.
- _validateLen(self, value)
- Check length of the user's value for this field.
- _validateMaxValue(self)
- getValue(self)
- Returns self.value in case of multi-valued input or
self.value[0] if only one value is allowed.
- labelHTML(self, labelText=None)
- setCharset(self, charset)
- Define the character set of the user's input.
- setDefault(self, default)
- Set the default of a field.
Mainly this is used by the application if self.default shall
be changed after initializing the field object.
- setRegex(self, pattern)
- Set the regex pattern for validating this field.
Mainly this is used if self._re shall be changed after
the field object was initialized.
pattern
Either a string containing a regex pattern,
a tuple (pattern string, pattern options) or None.
If None regex checking in _validateFormat is switched off
(not recommended).
- setValue(self, value)
- Store the user's value into the field object.
This method can be used to modify the user's value
before storing it into self.value.
|
class Radio(Field) |
|
Radio buttons:
<INPUT TYPE=RADIO> |
|
Methods defined here:
- __init__(self, name, text, maxValues=1, required=0, default=None, accessKey='', options=None)
- pattern and maxLen are determined from __init__ params
Additional parameters:
options=[]
List of options. Either just a list of strings
['value1','value2',..] for simple options
or a list of tuples of string pairs
[('value1','description1),('value2','description2),..]
for options with different option value and description.
- _defaultValue(self, default)
- HTML output of default.
- inputHTML(self, default=None)
- setDefault(self, default)
- Set the default of a default field.
Mainly this is used if self.default shall be changed after
initializing the field object.
- setOptions(self, options)
Data and non-method functions defined here:
- __doc__ = '\n Radio buttons:\n <INPUT TYPE=RADIO>\n '
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- __module__ = 'pyweblib.forms'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Methods inherited from Field:
- _accessKeyAttr(self)
- _defaultHTML(self, default)
- HTML output of default.
- _encodeValue(self, value)
- Return Unicode object or string to be stored in self.value
- _patternAndOptions(self, pattern)
- The result is a tuple (pattern string,pattern options).
pattern
Either a string containing a regex pattern,
a tuple (pattern string, pattern options) or None.
- _validateFormat(self, value)
- Check format of the user's value for this field.
Empty input (zero-length string) are valid in any case.
You might override this method to change this behaviour.
- _validateLen(self, value)
- Check length of the user's value for this field.
- _validateMaxValue(self)
- getValue(self)
- Returns self.value in case of multi-valued input or
self.value[0] if only one value is allowed.
- labelHTML(self, labelText=None)
- setCharset(self, charset)
- Define the character set of the user's input.
- setRegex(self, pattern)
- Set the regex pattern for validating this field.
Mainly this is used if self._re shall be changed after
the field object was initialized.
pattern
Either a string containing a regex pattern,
a tuple (pattern string, pattern options) or None.
If None regex checking in _validateFormat is switched off
(not recommended).
- setValue(self, value)
- Store the user's value into the field object.
This method can be used to modify the user's value
before storing it into self.value.
- valueHTML(self)
- HTML output of self.value using the HTML template string
in self.valueHTMLTemplate.
|
class Select(Radio) |
|
Select field:
<select multiple>
<option value="value">description</option>
</select> |
|
- Method resolution order:
- Select
- Radio
- Field
Methods defined here:
- __init__(self, name, text, maxValues, required=0, default=None, accessKey='', options=None, size=1, ignoreCase=0, multiSelect=0)
- Additional parameters:
size
Integer for the size of displayed select field.
ignorecase
Integer flag. If non-zero the case of input strings is ignored
when checking input values.
multiSelect
Integer flag. If non-zero the select field has HTML attribute
"multiple" set.
- inputHTML(self, default=None)
Data and non-method functions defined here:
- __doc__ = '\n Select field:\n <select multiple>\n <option value="value">description</option>\n </select>\n '
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- __module__ = 'pyweblib.forms'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Methods inherited from Radio:
- _defaultValue(self, default)
- HTML output of default.
- setDefault(self, default)
- Set the default of a default field.
Mainly this is used if self.default shall be changed after
initializing the field object.
- setOptions(self, options)
Methods inherited from Field:
- _accessKeyAttr(self)
- _defaultHTML(self, default)
- HTML output of default.
- _encodeValue(self, value)
- Return Unicode object or string to be stored in self.value
- _patternAndOptions(self, pattern)
- The result is a tuple (pattern string,pattern options).
pattern
Either a string containing a regex pattern,
a tuple (pattern string, pattern options) or None.
- _validateFormat(self, value)
- Check format of the user's value for this field.
Empty input (zero-length string) are valid in any case.
You might override this method to change this behaviour.
- _validateLen(self, value)
- Check length of the user's value for this field.
- _validateMaxValue(self)
- getValue(self)
- Returns self.value in case of multi-valued input or
self.value[0] if only one value is allowed.
- labelHTML(self, labelText=None)
- setCharset(self, charset)
- Define the character set of the user's input.
- setRegex(self, pattern)
- Set the regex pattern for validating this field.
Mainly this is used if self._re shall be changed after
the field object was initialized.
pattern
Either a string containing a regex pattern,
a tuple (pattern string, pattern options) or None.
If None regex checking in _validateFormat is switched off
(not recommended).
- setValue(self, value)
- Store the user's value into the field object.
This method can be used to modify the user's value
before storing it into self.value.
- valueHTML(self)
- HTML output of self.value using the HTML template string
in self.valueHTMLTemplate.
|
class Textarea(Field) |
|
Multi-line input field:
<textarea> |
|
Methods defined here:
- __init__(self, name, text, maxLen, maxValues, pattern, required=0, default=None, accessKey='', rows=10, cols=60)
- inputHTML(self, default=None)
- Returns string with HTML input field.
- setRegex(self, pattern)
- Like Field.setRegex() but pattern options re.S and re.M are
automatically added.
- valueHTML(self)
- HTML output of self.value using the HTML template string
in self.valueHTMLTemplate.
Data and non-method functions defined here:
- __doc__ = '\n Multi-line input field:\n <textarea>\n '
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- __module__ = 'pyweblib.forms'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Methods inherited from Field:
- _accessKeyAttr(self)
- _defaultHTML(self, default)
- HTML output of default.
- _defaultValue(self, default)
- HTML output of default.
- _encodeValue(self, value)
- Return Unicode object or string to be stored in self.value
- _patternAndOptions(self, pattern)
- The result is a tuple (pattern string,pattern options).
pattern
Either a string containing a regex pattern,
a tuple (pattern string, pattern options) or None.
- _validateFormat(self, value)
- Check format of the user's value for this field.
Empty input (zero-length string) are valid in any case.
You might override this method to change this behaviour.
- _validateLen(self, value)
- Check length of the user's value for this field.
- _validateMaxValue(self)
- getValue(self)
- Returns self.value in case of multi-valued input or
self.value[0] if only one value is allowed.
- labelHTML(self, labelText=None)
- setCharset(self, charset)
- Define the character set of the user's input.
- setDefault(self, default)
- Set the default of a field.
Mainly this is used by the application if self.default shall
be changed after initializing the field object.
- setValue(self, value)
- Store the user's value into the field object.
This method can be used to modify the user's value
before storing it into self.value.
|
class TooManyValues(FormException) |
|
User's input contained too many values for same parameter.
Attributes:
name name of input field (Field.name)
text textual description of input field (Field.text)
valueCount integer number of values counted with name
maxValueCount integer number of maximum values with name allowed |
|
- Method resolution order:
- TooManyValues
- FormException
- exceptions.Exception
Methods defined here:
- __init__(self, name, text, valueCount, maxValueCount)
- __str__(self)
Data and non-method functions defined here:
- __doc__ = "\n User's input contained too many values for sa...ger number of maximum values with name allowed\n "
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- __module__ = 'pyweblib.forms'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Methods inherited from FormException:
- html(self)
Methods inherited from exceptions.Exception:
- __getitem__(...)
|
class UndeclaredFieldName(FormException) |
|
Parameter with undeclared name attribute received.
Attributes:
name name of undeclared field |
|
- Method resolution order:
- UndeclaredFieldName
- FormException
- exceptions.Exception
Methods defined here:
- __init__(self, name)
- __str__(self)
Data and non-method functions defined here:
- __doc__ = '\n Parameter with undeclared name attribute rece...utes:\n name name of undeclared field\n '
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- __module__ = 'pyweblib.forms'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
Methods inherited from FormException:
- html(self)
Methods inherited from exceptions.Exception:
- __getitem__(...)
| |