Package couchdbkit :: Package schema :: Module properties :: Class DateTimeProperty
[hide private]
[frames] | no frames]

Class DateTimeProperty

source code

object --+    
         |    
  Property --+
             |
            DateTimeProperty
Known Subclasses:

DateTime property. It convert iso3339 string to python and vice-versa. Map to datetime.datetime object.

*ValueType*: datetime.datetime

Nested Classes [hide private]
  data_type
datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])
Instance Methods [hide private]
 
__init__(self, verbose_name=None, auto_now=False, auto_now_add=False, **kwds)
Default constructor for a property.
source code
 
validate(self, value, required=True)
validate value
source code
 
default_value(self)
return default value
source code
 
to_python(self, value)
convert to python type
source code
 
to_json(self, value)
convert to json, Converted value is saved in couchdb.
source code

Inherited from Property: __delete__, __get__, __property_config__, __property_init__, __set__, empty

Inherited from Property (private): _to_json, _to_python

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

Static Methods [hide private]
 
now() source code
Class Variables [hide private]

Inherited from Property: creation_counter

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, verbose_name=None, auto_now=False, auto_now_add=False, **kwds)
(Constructor)

source code 
Default constructor for a property.

:param verbose_name: str, verbose name of field, could
        be use for description
:param name: str, name of field
:param default: default value
:param required: True if field is required, default is False
:param validators: list of callable or callable, field validators
function that are executed when document is saved.

Overrides: object.__init__
(inherited documentation)

validate(self, value, required=True)

source code 

validate value

Overrides: Property.validate
(inherited documentation)

default_value(self)

source code 

return default value

Overrides: Property.default_value
(inherited documentation)

to_python(self, value)

source code 

convert to python type

Overrides: Property.to_python
(inherited documentation)

to_json(self, value)

source code 

convert to json, Converted value is saved in couchdb.

Overrides: Property.to_json
(inherited documentation)