コード例 #1
0
ファイル: ModelPrototype.py プロジェクト: fudong1127/Mojo
    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
コード例 #2
0
ファイル: ModelPrototype.py プロジェクト: lonelycode/Mojo
    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
コード例 #3
0
ファイル: ModelPrototype.py プロジェクト: fudong1127/Mojo
    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
コード例 #4
0
ファイル: ModelPrototype.py プロジェクト: lonelycode/Mojo
    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