def delete_bulk(klass, to_delete): """ Delete items in a batch operation (blocking) - takes a list of models as input """ from Mojo.ServerHelpers.RunServer import BACKEND_COLLECTION, DATABASE if DATABASE: if BACKEND_COLLECTION: this_collection = BACKEND_COLLECTION(DATABASE, klass) ret_obj = this_collection.delete(to_delete) return ret_obj
def delete_bulk(klass, to_delete): """ Delete items in a batch operation (blocking) - takes a list of models as input """ from Mojo.ServerHelpers.RunServer import BACKEND_COLLECTION, DATABASE if DATABASE: if BACKEND_COLLECTION: this_collection = BACKEND_COLLECTION(DATABASE, klass) ret_obj = this_collection.delete(to_delete) return ret_obj
def delete(self): """ Removes an item form the database, takes a model as input (blocking). """ from Mojo.ServerHelpers.RunServer import BACKEND_COLLECTION, DATABASE if DATABASE: if BACKEND_COLLECTION: this_collection = BACKEND_COLLECTION(DATABASE, self) ret_obj = this_collection.delete([self]) return ret_obj
def delete(self): """ Removes an item form the database, takes a model as input (blocking). """ from Mojo.ServerHelpers.RunServer import BACKEND_COLLECTION, DATABASE if DATABASE: if BACKEND_COLLECTION: this_collection = BACKEND_COLLECTION(DATABASE, self) ret_obj = this_collection.delete([self]) return ret_obj