Package snakelegs :: Module fields :: Class DateTimeField
[hide private]
[frames] | no frames]

Class DateTimeField

object --+    
         |    
 BaseField --+
             |
            DateTimeField

A field that takes a date, time, ordatetime value. The optional constructor parameter autonow determines whether the value will default to the current datetime. If a time is supplied to this field, it will be converted into a datetime using the current date. If a date is supplied, it will be converted into a datetime using midnight of the given date

Instance Methods [hide private]
 
__init__(self, default=None, autonow=False)
x.__init__(...) initializes x; see help(type(x)) for signature
 
setvalue(self, value)
Set the value that this field will hold.
 
deferred(self)
Perform deferred initialization on this field.

Inherited from BaseField: dbgetvalue, delvalue, getvalue

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from BaseField: value

Inherited from object: __class__

Method Details [hide private]

__init__(self, default=None, autonow=False)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

setvalue(self, value)

 

Set the value that this field will hold. You should use this method to perform validation as well. Raise a TypeError if value is of the incorrect type. By default, this method stores value in self._value

Overrides: BaseField.setvalue
(inherited documentation)

deferred(self)

 

Perform deferred initialization on this field. This should be used whenever there are values that should be set when an instance of the Document object is created rather than when the Document class is created

Overrides: BaseField.deferred
(inherited documentation)