コード例 #1
0
ファイル: editor.py プロジェクト: muddery/muddery
    def func(self, args, request):
        if not args:
            raise MudderyError(ERR.missing_args, 'Missing arguments.')

        if 'typeclass' not in args:
            raise MudderyError(ERR.missing_args, 'Missing the argument: "typeclass".')

        typeclass = args["typeclass"]
        width = args.get("width", 0)
        height = args.get("height", 0)

        forms = data_edit.query_object_form(typeclass, typeclass, None)
        new_area = []
        for form in forms:
            values = {field["name"]: field["value"] for field in form["fields"] if "value" in field}
            values["width"] = width
            values["height"] = height

            new_area.append({
                "table": form["table"],
                "values": values
            })

        obj_key = data_edit.save_object_form(new_area, typeclass, "")
        data = {"key": obj_key,
                "width": width,
                "height": height}
        return success_response(data)
コード例 #2
0
ファイル: editor.py プロジェクト: muddery/muddery
    def func(self, args, request):
        if not args:
            raise MudderyError(ERR.missing_args, 'Missing arguments.')

        if 'typeclass' not in args:
            raise MudderyError(ERR.missing_args, 'Missing the argument: "typeclass".')

        if 'location' not in args:
            raise MudderyError(ERR.missing_args, 'Missing the argument: "location".')

        if 'destination' not in args:
            raise MudderyError(ERR.missing_args, 'Missing the argument: "destination".')

        typeclass = args["typeclass"]
        location = args["location"]
        destination = args["destination"]

        forms = data_edit.query_object_form(typeclass, typeclass, None)
        new_exit = []
        for form in forms:
            values = {field["name"]: field["value"] for field in form["fields"] if "value" in field}
            values["location"] = location
            values["destination"] = destination

            new_exit.append({
                "table": form["table"],
                "values": values
            })

        obj_key = data_edit.save_object_form(new_exit, typeclass, "")
        data = {"key": obj_key}
        return success_response(data)
コード例 #3
0
    def func(self, args, request):
        if not args:
            raise MudderyError(ERR.missing_args, 'Missing arguments.')

        if 'typeclass' not in args:
            raise MudderyError(ERR.missing_args,
                               'Missing the argument: "typeclass".')

        if 'location' not in args:
            raise MudderyError(ERR.missing_args,
                               'Missing the argument: "location".')

        if 'destination' not in args:
            raise MudderyError(ERR.missing_args,
                               'Missing the argument: "destination".')

        typeclass = args["typeclass"]
        location = args["location"]
        destination = args["destination"]

        forms = data_edit.query_object_form(typeclass, typeclass, None)
        new_exit = []
        for form in forms:
            values = {
                field["name"]: field["value"]
                for field in form["fields"] if "value" in field
            }
            values["location"] = location
            values["destination"] = destination

            new_exit.append({"table": form["table"], "values": values})

        obj_key = data_edit.save_object_form(new_exit, typeclass, "")
        data = {"key": obj_key}
        return success_response(data)
コード例 #4
0
    def func(self, args, request):
        if not args:
            raise MudderyError(ERR.missing_args, 'Missing arguments.')

        if 'typeclass' not in args:
            raise MudderyError(ERR.missing_args,
                               'Missing the argument: "typeclass".')

        typeclass = args["typeclass"]
        width = args.get("width", 0)
        height = args.get("height", 0)

        forms = data_edit.query_object_form(typeclass, typeclass, None)
        new_area = []
        for form in forms:
            values = {
                field["name"]: field["value"]
                for field in form["fields"] if "value" in field
            }
            values["width"] = width
            values["height"] = height

            new_area.append({"table": form["table"], "values": values})

        obj_key = data_edit.save_object_form(new_area, typeclass, "")
        data = {"key": obj_key, "width": width, "height": height}
        return success_response(data)
コード例 #5
0
    def func(self, args, request):
        if not args:
            raise MudderyError(ERR.missing_args, 'Missing arguments.')

        if 'tables' not in args:
            raise MudderyError(ERR.missing_args,
                               'Missing the argument: "tables".')

        if 'base_typeclass' not in args:
            raise MudderyError(ERR.missing_args,
                               'Missing the argument: "base_typeclass".')

        if 'obj_typeclass' not in args:
            raise MudderyError(ERR.missing_args,
                               'Missing the argument: "obj_typeclass".')

        if 'obj_key' not in args:
            raise MudderyError(ERR.missing_args,
                               'Missing the argument: "obj_key".')

        tables = args["tables"]
        base_typeclass = args["base_typeclass"]
        obj_typeclass = args["obj_typeclass"]
        obj_key = args["obj_key"]

        obj_key = data_edit.save_object_form(tables, obj_typeclass, obj_key)
        data = data_edit.query_object_form(base_typeclass, obj_typeclass,
                                           obj_key)
        return success_response(data)
コード例 #6
0
ファイル: editor.py プロジェクト: muddery/muddery
    def func(self, args, request):
        if not args:
            raise MudderyError(ERR.missing_args, 'Missing arguments.')

        if 'base_typeclass' not in args:
            raise MudderyError(ERR.missing_args, 'Missing the argument: "base_typeclass".')

        base_typeclass = args["base_typeclass"]
        obj_typeclass = args.get('obj_typeclass', None)
        obj_key = args.get('obj_key', None)

        data = data_edit.query_object_form(base_typeclass, obj_typeclass, obj_key)
        return success_response(data)
コード例 #7
0
    def func(self, args, request):
        if not args:
            raise MudderyError(ERR.missing_args, 'Missing arguments.')

        if 'base_typeclass' not in args:
            raise MudderyError(ERR.missing_args,
                               'Missing the argument: "base_typeclass".')

        base_typeclass = args["base_typeclass"]
        obj_typeclass = args.get('obj_typeclass', None)
        obj_key = args.get('obj_key', None)

        data = data_edit.query_object_form(base_typeclass, obj_typeclass,
                                           obj_key)
        return success_response(data)