Source

audrid / audrid / models.py

Diff from to

File audrid/models.py

         return '<Document %s, type=%s, length=%s, deleted=%s>' % (
             self.id, self.type, len(self.body), self.deleted)
 
+    def as_dict(self):
+        return {
+            "id" : self.id,
+            "body" : json.loads(self.body),
+            "type" : self.type,
+            "deleted" : self.deleted,
+        }
+
     def to_python(self):
         """ Return the python representation (dictionary) of this document.
         """