Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
channels
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gaoming
channels
Commits
34657e6a
Commit
34657e6a
authored
Jun 05, 2019
by
gaoming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
good morning
parent
ef0f5eda
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
4 deletions
+11
-4
models.cpython-35.pyc
like/__pycache__/models.cpython-35.pyc
+0
-0
views.cpython-35.pyc
like/__pycache__/views.cpython-35.pyc
+0
-0
models.py
like/models.py
+1
-2
views.py
like/views.py
+10
-2
No files found.
like/__pycache__/models.cpython-35.pyc
View file @
34657e6a
No preview for this file type
like/__pycache__/views.cpython-35.pyc
View file @
34657e6a
No preview for this file type
like/models.py
View file @
34657e6a
...
...
@@ -74,7 +74,7 @@ class PromotionChannel(models.Model):
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的数据
if
request
:
...
...
@@ -92,7 +92,6 @@ class PromotionChannel(models.Model):
try
:
promotion
=
PromotionChannel
.
objects
.
create
(
**
params
)
except
Exception
as
e
:
#字典转字符串
print
(
str
(
e
))
return
False
,
CHANNEL_STATUS
.
ADD_FAIL_GENERAL
...
...
like/views.py
View file @
34657e6a
...
...
@@ -123,7 +123,10 @@ class Statistic(View):
return
JsonResponse
({
'error'
:
0
,
'msg'
:
''
})
class
DoubleCheck
(
View
):
'''
查重复
'''
...
...
@@ -138,7 +141,12 @@ class Channel(View):
platform
=
request
.
path
.
split
(
'/'
)[
2
]
#获得渠道数据
data
=
Channel
.
__dict__
.
get
(
platform
)(
self
)
try
:
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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment