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

Module properties

source code

properties used by Document object

Classes [hide private]
  Property
Property base which all other properties inherit.
  StringProperty
string property str or unicode property
  IntegerProperty
Integer property.
  LongProperty
Integer property.
  FloatProperty
Float property, map to python float
  Number
Float property, map to python float
  BooleanProperty
Boolean property, map to python bool
  DecimalProperty
Decimal property, map to Decimal python object
  DateTimeProperty
DateTime property.
  DateProperty
Date property, like DateTime property but only for Date.
  TimeProperty
Date property, like DateTime property but only for time.
  DictProperty
A property that stores a dict of things
  ListProperty
A property that stores a list of things.
  StringListProperty
shorthand for list that should containe only unicode
  LazyDict
object to make sure we keep updated of dict in _doc.
  LazyList
object to make sure we keep update of list in _doc.
  SetProperty
A property that stores a Python set as a list of unique elements.
  LazySet
Object to make sure that we keep set and _doc synchronized.
Functions [hide private]
 
is_iterable(c) source code
 
convert_property(value)
convert a value to json from Property._to_json
source code
 
value_to_property(value)
Convert value in a Property object
source code
 
validate_list_content(value, item_type=None)
validate type of values in a list
source code
 
validate_dict_content(value, item_type=None)
validate type of values in a dict
source code
 
validate_set_content(value, item_type=None)
validate type of values in a set
source code
 
validate_content(value, item_type=None)
validate a value.
source code
 
dict_to_json(value, item_type=None)
convert a dict to json
source code
 
list_to_json(value, item_type=None)
convert a list to json
source code
 
value_to_json(value, item_type=None)
convert a value to json using appropriate regexp.
source code
 
is_type_ok(item_type, value_type) source code
 
value_to_python(value, item_type=None)
convert a json value to python type using regexp.
source code
 
list_to_python(value, item_type=None)
convert a list of json values to python list
source code
 
dict_to_python(value, item_type=None)
convert a json object values to python dict
source code
Variables [hide private]
  support_setproperty = True
  ALLOWED_PROPERTY_TYPES = set([<type 'bool'>, <type 'float'>, <...
  re_date = re.compile(r'^(\d{4})\D?(0[1-9]|1[0-2])\D?([12]\d|0[...
  re_time = re.compile(r'^([01]\d|2[0-3])\D?([0-5]\d)\D?([0-5]\d...
  re_datetime = re.compile(r'^(\d{4})\D?(0[1-9]|1[0-2])\D?([12]\...
  re_decimal = re.compile(r'^(\d+)\.(\d+)$')
  MAP_TYPES_PROPERTIES = {<type 'bool'>: <class 'couchdbkit.sche...
  __package__ = 'couchdbkit.schema'
Function Details [hide private]

validate_content(value, item_type=None)

source code 

validate a value. test if value is in supported types

value_to_json(value, item_type=None)

source code 

convert a value to json using appropriate regexp. For Dates we use ISO 8601. Decimal are converted to string.

value_to_python(value, item_type=None)

source code 

convert a json value to python type using regexp. values converted have been put in json via `value_to_json` .


Variables Details [hide private]

ALLOWED_PROPERTY_TYPES

Value:
set([<type 'bool'>,
     <type 'float'>,
     <type 'int'>,
     <type 'list'>,
     <type 'long'>,
     <type 'dict'>,
     <type 'NoneType'>,
     <type 'set'>,
...

re_date

Value:
re.compile(r'^(\d{4})\D?(0[1-9]|1[0-2])\D?([12]\d|0[1-9]|3[01])$')

re_time

Value:
re.compile(r'^([01]\d|2[0-3])\D?([0-5]\d)\D?([0-5]\d)?\D?(\d{3})?$')

re_datetime

Value:
re.compile(r'^(\d{4})\D?(0[1-9]|1[0-2])\D?([12]\d|0[1-9]|3[01])(\D?([0\
1]\d|2[0-3])\D?([0-5]\d)\D?([0-5]\d)?\D?(\d{3})?([zZ]|([\+-])([01]\d|2\
[0-3])\D?([0-5]\d)?)?)?$')

MAP_TYPES_PROPERTIES

Value:
{<type 'bool'>: <class 'couchdbkit.schema.properties.BooleanProperty'>\
,
 <type 'float'>: <class 'couchdbkit.schema.properties.FloatProperty'>,
 <type 'int'>: <class 'couchdbkit.schema.properties.IntegerProperty'>,
 <type 'list'>: <class 'couchdbkit.schema.properties.ListProperty'>,
 <type 'long'>: <class 'couchdbkit.schema.properties.IntegerProperty'>\
,
 <type 'dict'>: <class 'couchdbkit.schema.properties.DictProperty'>,
...