Commit cb6a9a6f authored by zhongshangwu's avatar zhongshangwu

标签编辑增加参数

parent 8737f61d
...@@ -53,6 +53,12 @@ class TagUpdateOrCreateView(APIView): ...@@ -53,6 +53,12 @@ class TagUpdateOrCreateView(APIView):
down_tags = list(set(map(lambda x: x.split(":")[0], json.loads((request.POST.get('down_tags', '[]')))))) down_tags = list(set(map(lambda x: x.split(":")[0], json.loads((request.POST.get('down_tags', '[]'))))))
up_tags = list(set(map(lambda x: x.split(":")[0], json.loads((request.POST.get('up_tags', '[]')))))) up_tags = list(set(map(lambda x: x.split(":")[0], json.loads((request.POST.get('up_tags', '[]'))))))
tagtypes = list(set(map(lambda x: x.split(":")[0], json.loads((request.POST.get('tagtypes', '[]')))))) tagtypes = list(set(map(lambda x: x.split(":")[0], json.loads((request.POST.get('tagtypes', '[]'))))))
request.POST.get('official_pictorial_id', '').split(":")
official_pictorial_id = request.POST.get('official_pictorial_id', '').split(":")
if official_pictorial_id:
official_pictorial_id = official_pictorial_id[0]
else:
official_pictorial_id = None
data = { data = {
'name': request.POST.get('name').lower(), 'name': request.POST.get('name').lower(),
...@@ -64,6 +70,8 @@ class TagUpdateOrCreateView(APIView): ...@@ -64,6 +70,8 @@ class TagUpdateOrCreateView(APIView):
'platform': request.POST.get('platform', 1), 'platform': request.POST.get('platform', 1),
'collection': request.POST.get('collection', 0), 'collection': request.POST.get('collection', 0),
'alias': request.POST.get('alias', ''), 'alias': request.POST.get('alias', ''),
'is_core': request.POST.get('is_core', 0),
'official_pictorial_id': official_pictorial_id,
'is_show_in_register': request.POST.get('is_show_in_register', 'false'), 'is_show_in_register': request.POST.get('is_show_in_register', 'false'),
'pictorial_ids': list( 'pictorial_ids': list(
(map(lambda x: int(x.split(":")[0]), json.loads((request.POST.get('pictorial_ids', '[]')))))) (map(lambda x: int(x.split(":")[0]), json.loads((request.POST.get('pictorial_ids', '[]'))))))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment