Commit 1116ae10 authored by yangchenglin's avatar yangchenglin

fix

parent 024c17d1
......@@ -27,17 +27,21 @@ class WordParentInfoView(APIView):
class WordParentCreateView(APIView):
def post(self, request):
name = request.POST.get('name', None)
children_words = json.loads(request.POST.get('children_words', '[]'))
content_ad = request.POST.get('content_ad', '')
makeup_ad = request.POST.get('makeup_ad', '')
dress_ad = request.POST.get('dress_ad', '')
gender = request.POST.get('gender', 0)
if not name:
return r'缺少参数'
data = self.rpc['venus/sun/word_parent/add'](name=name, children_words=children_words, content_ad=content_ad, makeup_ad=makeup_ad, dress_ad=dress_ad, gender=gender).unwrap()
data = {}
data["name"] = request.POST.get('name', None)
children_words = request.POST.get('children_words')
data["children_words"] = json.loads(children_words) if children_words else []
data["content_ad"] = request.POST.get('content_ad', None)
data["makeup_ad"] = request.POST.get('makeup_ad', None)
data["dress_ad"] = request.POST.get('dress_ad', None)
data["gender"] = request.POST.get('gender', None)
makeup_pictorial_ids = request.POST.get('makeup_pictorial_ids')
clothing_pictorial_ids = request.POST.get('clothing_pictorial_ids')
data["makeup_pictorial_ids"] = json.loads(makeup_pictorial_ids) if makeup_pictorial_ids else []
data["clothing_pictorial_ids"] = json.loads(clothing_pictorial_ids) if clothing_pictorial_ids else []
data = self.rpc['venus/sun/word_parent/add'](data=data).unwrap()
return data
......@@ -46,6 +50,8 @@ class WordParentUpdateView(APIView):
def post(self, request):
import ipdb
ipdb.set_trace()
data = {}
data["id"] = request.POST.get('id', None)
data["name"] = request.POST.get('name', None)
......@@ -60,6 +66,8 @@ class WordParentUpdateView(APIView):
data["makeup_pictorial_ids"] = json.loads(makeup_pictorial_ids) if makeup_pictorial_ids else []
data["clothing_pictorial_ids"] = json(clothing_pictorial_ids) if clothing_pictorial_ids else []
import ipdb
ipdb.set_trace()
data = self.rpc['venus/sun/word_parent/edit'](data=data).unwrap()
if not data:
return r'更新失败'
......
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