def save(self, versioning=True, *args, **kwargs):
        if versioning:
            if '_revision' in self:
                self.pop('_revision')
                self['_revision'] = self.get_last_revision_id()
            else:
                self['_revision'] = 0
            self['_revision'] += 1
            super(VersionedDocument, self).save(*args, **kwargs)
            versionned_doc = RevisionDocument({"id": unicode(self['_id']), "revision": self['_revision']},
                                              collection=self.versioning_collection)
            versionned_doc['doc'] = dict(self)
            versionned_doc.save()
        else:
            super(VersionedDocument, self).save(*args, **kwargs)
        return self
dataset/ETHPy150Open namlook/mongokit/mongokit/versioned_document.py/VersionedDocument.save/original