

def save(self):
    '\n        Saves the model instance to the database (blocking), unlike insert() this is an instance method so needs to be called by\n        and instantiated model instance::\n\n            from models import MyTestModel\n\n            my_data = {\n                    \'this_field\':       "Hello World",\n                    \'another_field\':    42,\n                    \'whatever_field\':   True\n                  }\n\n            model_instance = MyTestModel(my_data)\n            model_instance.save()\n\n        '
    from Mojo.ServerHelpers.RunServer import BACKEND_COLLECTION, DATABASE
    if DATABASE:
        if BACKEND_COLLECTION:
            this_collection = BACKEND_COLLECTION(DATABASE, self)
            self.validate()
            ret_obj = this_collection.save(self)
            return ret_obj

dataset/ETHPy150Open lonelycode/Mojo/Mojo/ObjectMapper/ModelPrototype.py Model.save/original