Commit f0df3672 authored by 钟尚武's avatar 钟尚武

Merge branch 'shangwu/feature-tag' into 'test'

标签编辑增加参数

See merge request alpha/sun!334
parents 8737f61d cb6a9a6f
......@@ -48,11 +48,17 @@ class TagUpdateOrCreateView(APIView):
return {'data': data}
def post(self, request):
id = request.POST.get('id')
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', '[]'))))))
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 = {
'name': request.POST.get('name').lower(),
......@@ -64,6 +70,8 @@ class TagUpdateOrCreateView(APIView):
'platform': request.POST.get('platform', 1),
'collection': request.POST.get('collection', 0),
'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'),
'pictorial_ids': list(
(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