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

Module schema

source code

Wrapper of couchdbkit Document and Properties for django. It also add possibility to a document to register itself in CouchdbkitHandler

Classes [hide private]
  Options
class based on django.db.models.options.
  DocumentMeta
  Document
Document object for django extension
  DocumentSchema
  Property
Property base which all other properties inherit.
  StringProperty
string property str or unicode property
  IntegerProperty
Integer property.
  DecimalProperty
Decimal property, map to Decimal python object
  BooleanProperty
Boolean property, map to python bool
  FloatProperty
Float property, map to python float
  DateTimeProperty
DateTime property.
  DateProperty
Date property, like DateTime property but only for Date.
  TimeProperty
Date property, like DateTime property but only for time.
  SchemaProperty
Schema property.
  SchemaListProperty
A property that stores a list of things.
  ListProperty
A property that stores a list of things.
  DictProperty
A property that stores a dict of things
  StringListProperty
shorthand for list that should containe only unicode
  SchemaDictProperty
A property that stores a dict of things.
  SetProperty
A property that stores a Python set as a list of unique elements.
Functions [hide private]
 
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
 
value_to_python(value, item_type=None)
convert a json value to python type using regexp.
source code
 
dict_to_python(value, item_type=None)
convert a json object values to python dict
source code
 
list_to_python(value, item_type=None)
convert a list of json values to python list
source code
 
convert_property(value)
convert a value to json from Property._to_json
source code
Variables [hide private]
  DEFAULT_NAMES = ('verbose_name', 'db_table', 'ordering', 'app_...
  __package__ = 'couchdbkit.ext.django'
Function Details [hide private]

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]

DEFAULT_NAMES

Value:
('verbose_name', 'db_table', 'ordering', 'app_label')