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)
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)
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)