def save(self, force=False, uuid=False, **kwargs):
        """
          REPLACES the object in DB. This is forbidden with objects from find() methods unless force=True is given.
        """

        if not self._initialized_with_doc and not force:
            raise Exception("Cannot save a document not initialized from a Python dict. This might remove fields from the DB!")

        self._initialized_with_doc = False

        if '_id' not in self:
            if uuid:
                self['_id'] = str("%s-%s" % (self.mongokat_collection.__class__.__name__, uuid4()))

        return self.mongokat_collection.save(self, **kwargs)
def save ( self , force = False , uuid = False , ** kwargs ) : if not self . _initialized_with_doc and not force : raise Exception ( "Cannot save a document not initialized from a Python dict. This might remove fields from the DB!" ) self . _initialized_with_doc = False if '_id' not in self : if uuid : self [ '_id' ] = str ( "%s-%s" % ( self . mongokat_collection . __class__ . __name__ , uuid4 ( ) ) ) return self . mongokat_collection . save ( self , ** kwargs )
REPLACES the object in DB. This is forbidden with objects from find() methods unless force=True is given.