fix upload template and add /api/v0.1/attributes/<int:attr_id>/calc_computed_attribute

This commit is contained in:
pycook
2023-09-11 19:15:31 +08:00
parent 2c74d107dd
commit 94cdb42477
3 changed files with 29 additions and 21 deletions

View File

@@ -56,12 +56,7 @@ class AttributeView(APIView):
@args_required("name")
@args_validate(AttributeManager.cls)
def post(self, attr_id=None):
if request.url.endswith("/calc_computed_attribute"):
AttributeManager.calc_computed_attribute(attr_id)
return self.jsonify(attr_id=attr_id)
def post(self):
choice_value = handle_arg_list(request.values.get("choice_value"))
params = request.values
params["choice_value"] = choice_value
@@ -74,6 +69,11 @@ class AttributeView(APIView):
@args_validate(AttributeManager.cls)
def put(self, attr_id):
if request.url.endswith("/calc_computed_attribute"):
AttributeManager.calc_computed_attribute(attr_id)
return self.jsonify(attr_id=attr_id)
choice_value = handle_arg_list(request.values.get("choice_value"))
params = request.values
params["choice_value"] = choice_value