| Class: Field | qm/fields.py | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
A
|
FormatValueAsText
|
|
FormatValueAsText (
self,
value,
columns=72,
)
Return a plain text rendering of a
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GetBriefDescription | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GetBriefDescription ( self ) Return a brief description of this field.This description is used when prompting for input, or when displaying the current value of the field. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GetDefaultValue | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GetDefaultValue ( self ) Return the default value for this field. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GetDescription | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GetDescription ( self ) Return a description of this field.This description is used when displaying detailed help information about the field. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GetHelp | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GetHelp ( self ) Generate help text about this field in structured text format.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GetHtmlFormFieldName | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GetHtmlFormFieldName ( self ) Return the form field name corresponding this field.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GetHtmlHelp | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GetHtmlHelp ( self, edit=0 ) Generate help text about this field in HTML format.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GetName | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GetName ( self ) Return the name of the field. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GetSubfields | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GetSubfields ( self ) Returns the sequence of subfields contained in this field.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GetTitle | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GetTitle ( self ) Return the user-friendly title of the field. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| GetValueFromDomNode | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GetValueFromDomNode (
self,
node,
attachment_store,
)
Return a value for this field represented by DOM
|
| Exceptions | |
|---|---|
|
NotImplementedError |
IsComputed ( self )
IsHidden ( self )
Field should be hidden from users.Field should be hidden from users.
The value of a hidden field is not displayed in the GUI.IsReadOnly ( self )
Field cannot be modified by users.Field cannot be modified by users.
The GUI does not allow users to modify a read-only field.
MakeDomNodeForValue (
self,
value,
document,
)
valuedocument| Exceptions | |
|---|---|
|
NotImplementedError |
ParseFormValue (
self,
request,
name,
attachment_stores,
)
requestWebRequest containing a value corresponding
to this field.namerequest.attachment_storesAttachmentStore ids
(in the sense of Python's id built-in) to the
'AttachmentStore's themselves.(value, redisplay). value is the value
for this field, as indicated in request. redisplay is true
if and only if the form should be redisplayed, rather than
committed. If an error occurs, an exception is thrown.ParseTextValue ( self, value )
valueValidate to ensure that it is valid
before it is returned.| Exceptions | |
|---|---|
|
NotImplemented |
Validate ( self, value )
For an acceptable type and value, return the representation of
value in the underlying field storage.
valuevalue 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.
| Exceptions | |
|---|---|
|
NotImplementedError |
__init__ (
self,
name,
default_value,
title="",
description="",
hidden="false",
read_only="false",
computed="false",
)
namedefault_valuetitledescriptiondescription must be provided as structured text. The
first line of the structured text must be a one-sentence
description of the field; that line is extracted by
GetBriefDescription.hiddenread_onlycomputed The boolean parameters (such as hidden) use the convention
that true is represented by the string '"true"'; any other value
is false. This convention is a historical artifact.
__repr__ ( self )