1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 """ Wrapper of couchdbkit Document and Properties for django. It also
18 add possibility to a document to register itself in CouchdbkitHandler
19 """
20
21 import sys
22
23 from couchdbkit import schema
24 from couchdbkit.ext.django.loading import get_schema, register_schema
25
26 __all__ = ['Property', 'StringProperty', 'IntegerProperty',
27 'DecimalProperty', 'BooleanProperty', 'FloatProperty',
28 'DateTimeProperty', 'DateProperty', 'TimeProperty',
29 'dict_to_json', 'list_to_json', 'value_to_json',
30 'value_to_python', 'dict_to_python', 'list_to_python',
31 'convert_property', 'DocumentSchema', 'Document',
32 'SchemaProperty', 'ListProperty',
33 'DictProperty', 'StringListProperty']
34
48
50 """ Document object for django extension """
51 __metaclass__ = DocumentMeta
52
53 get_id = property(lambda self: self['_id'])
54 get_rev = property(lambda self: self['_rev'])
55
56
57 DocumentSchema = schema.DocumentSchema
58
59
60 Property = schema.Property
61 StringProperty = schema.StringProperty
62 IntegerProperty = schema.IntegerProperty
63 DecimalProperty = schema.DecimalProperty
64 BooleanProperty = schema.BooleanProperty
65 FloatProperty = schema.FloatProperty
66 DateTimeProperty = schema.DateTimeProperty
67 DateProperty = schema.DateProperty
68 TimeProperty = schema.TimeProperty
69 SchemaProperty = schema.SchemaProperty
70 ListProperty = schema.ListProperty
71 DictProperty = schema.DictProperty
72 StringListProperty = schema.StringListProperty
73
74
75
76 dict_to_json = schema.dict_to_json
77 list_to_json = schema.list_to_json
78 value_to_json = schema.value_to_json
79 value_to_python = schema.value_to_python
80 dict_to_python = schema.dict_to_python
81 list_to_python = schema.list_to_python
82 convert_property = schema.convert_property
83