Package qm :: Module fields :: Class TimeField
[hide private]
[frames] | no frames]

Class TimeField
source code

object --+        
         |        
     Field --+    
             |    
  IntegerField --+
                 |
                TimeField

A field containing a date and time.

The data and time is stored as seconds since the start of the UNIX epoch, UTC (the semantics of the standard 'time' function), with one-second precision. User representations of 'TimeField' fields show one-minue precision.

Instance Methods [hide private]
  __init__(self, name="", **properties)
Create a time field.
  GetHelp(self)
Generate help text about this field in structured text format.
  FormatValueAsText(self, value, columns=72)
Return a plain text rendering of a 'value' for this field.
  FormatValueAsHtml(self, server, value, style, name=None)
Return an HTML rendering of a 'value' for this field.
  ParseTextValue(self, value)
Parse a value represented as a string.
  GetDefaultValue(self)
Return the default value for this field.

Inherited from IntegerField: GetValueFromDomNode, MakeDomNodeForValue, Validate

Inherited from Field: GetBriefDescription, GetDescription, GetHtmlFormFieldName, GetHtmlHelp, GetName, GetSubfields, GetTitle, IsComputed, IsHidden, IsReadOnly, ParseFormValue, SetName, __repr__

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__


Class Variables [hide private]

Inherited from Field: form_field_prefix

Inherited from object: __class__


Method Details [hide private]

__init__(self, name="", **properties)
(Constructor)

source code 

Create a time field.

The field is given a default value for this field is 'None', which corresponds to the current time when the field value is first created.
Overrides: IntegerField.__init__

GetHelp(self)

source code 
Generate help text about this field in structured text format.
Overrides: IntegerField.GetHelp

FormatValueAsText(self, value, columns=72)

source code 

Return a plain text rendering of a 'value' for this field.

'columns' -- The maximum width of each line of text.

returns -- A plain-text string representing 'value'.
Overrides: IntegerField.FormatValueAsText

FormatValueAsHtml(self, server, value, style, name=None)

source code 

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'.
Overrides: IntegerField.FormatValueAsHtml

ParseTextValue(self, value)

source code 

Parse a value represented as a string.

'value' -- A string representing the value.

returns -- The corresponding field value. The value returned should be processed by 'Validate' to ensure that it is valid before it is returned.
Overrides: IntegerField.ParseTextValue

GetDefaultValue(self)

source code 
Return the default value for this field.
Overrides: Field.GetDefaultValue
(inherited documentation)