Commit 34657e6a authored by gaoming's avatar gaoming

good morning

parent ef0f5eda
...@@ -74,7 +74,7 @@ class PromotionChannel(models.Model): ...@@ -74,7 +74,7 @@ class PromotionChannel(models.Model):
keys=kwargs.keys() keys=kwargs.keys()
#查找存在表中的字段 #查找存在表中的字段
params={key:value for key,value in kwargs.items() if key in propertys} params={key.lower().strip():value for key,value in kwargs.items() if key.lower().strip() in propertys}
#获得request的数据 #获得request的数据
if request: if request:
...@@ -92,7 +92,6 @@ class PromotionChannel(models.Model): ...@@ -92,7 +92,6 @@ class PromotionChannel(models.Model):
try: try:
promotion= PromotionChannel.objects.create(**params) promotion= PromotionChannel.objects.create(**params)
except Exception as e: except Exception as e:
#字典转字符串
print(str(e)) print(str(e))
return False,CHANNEL_STATUS.ADD_FAIL_GENERAL return False,CHANNEL_STATUS.ADD_FAIL_GENERAL
......
...@@ -123,7 +123,10 @@ class Statistic(View): ...@@ -123,7 +123,10 @@ class Statistic(View):
return JsonResponse({'error':0, 'msg':''}) return JsonResponse({'error':0, 'msg':''})
class DoubleCheck(View):
'''
查重复
'''
...@@ -138,7 +141,12 @@ class Channel(View): ...@@ -138,7 +141,12 @@ class Channel(View):
platform=request.path.split('/')[2] platform=request.path.split('/')[2]
#获得渠道数据 #获得渠道数据
try:
data=Channel.__dict__.get(platform)(self) data=Channel.__dict__.get(platform)(self)
except Exception as e:
print(str(e))
return JsonResponse({'code':1,'failMsg':"not exists method to handle it!"})
result,msg=PromotionChannel.record(request,**data) result,msg=PromotionChannel.record(request,**data)
......
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