| Home | Trees | Index | Help |
|---|
| Package qm :: Module fields :: Class ChoiceField |
|
object--+ |Field--+ |TextField--+ | ChoiceField
EnumerationField,
ResourceField,
TestFieldA 'ChoiceField' allows choosing one of several values.
The set of acceptable values can be determined when the field is created or dynamically. The empty string is used as the "no choice" value, and cannot therefore be one of the permitted values.| Method Summary | |
|---|---|
Return an HTML rendering of a 'value' for this field. | |
Return the options from which to choose. | |
Validate a field value. | |
| Inherited from TextField | |
Construct a new 'TextField'. | |
Return a plain text rendering of a 'value' for this field. | |
Generate help text about this field in structured text format. | |
Return a value for this field represented by DOM 'node'. | |
Generate a DOM element node for a value of this field. | |
Convert a value submitted from an HTML form. | |
Parse a value represented as a string. | |
| Inherited from Field | |
| |
Return a brief description of this field. | |
Return the default value for this field. | |
Return a description of this field. | |
Return the form field name corresponding this field. | |
Generate help text about this field in HTML format. | |
Return the name of the field. | |
Returns the sequence of subfields contained in this field. | |
Return the user-friendly title of the field. | |
Returns true if this field is computed automatically. | |
Returns true if this 'Field' should be hidden from users. | |
Returns true if this 'Field' cannot be modified by users. | |
Set the name of the field. | |
| Inherited from object | |
x.__delattr__('name') <==> del x.name | |
x.__getattribute__('name') <==> x.name | |
x.__hash__() <==> hash(x) | |
T.__new__(S, ...) -> a new object with type S, a subtype of T | |
helper for pickle | |
helper for pickle | |
x.__setattr__('name', value) <==> x.name = value | |
x.__str__() <==> str(x) | |
| Class Variable Summary | |
|---|---|
| Inherited from Field | |
str |
form_field_prefix = '_field_'
|
| Method Details |
|---|
FormatValueAsHtml(self, server, value, style, name=None)Return an HTML rendering of a 'value' for this field. 'server' -- The 'WebServer' in which the HTML will be displayed. 'value' -- The value for this field. May be 'None', which renders a default value (useful for blank forms). 'style' -- The rendering style. Can be "full" or "brief" (both read-only), or "new" or "edit" or "hidden". 'name' -- The name to use for the primary HTML form element containing the value of this field, if 'style' specifies the generation of form elements. If 'name' is 'None', the value returned by 'GetHtmlFormFieldName()' should be used. returns -- A string containing the HTML representation of 'value'.
|
GetItems(self)Return the options from which to choose. returns -- A sequence of strings, each of which will be presented as a choice for the user. |
Validate(self, value)Validate a field value. For an acceptable type and value, return the representation of 'value' in the underlying field storage. 'value' -- A value to validate for this field. returns -- If the 'value' is valid, returns 'value' or an equivalent "canonical" version of 'value'. (For example, this function may search a hash table and return an equivalent entry from the hash table.) This function must raise an exception if the value is not valid. The string representation of the exception will be used as an error message in some situations. Implementations of this method must be idempotent.
|
| Home | Trees | Index | Help |
|---|
| Generated by Epydoc 2.1 on Thu Sep 27 15:49:05 2007 | http://epydoc.sf.net |