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
d09b3a21
Commit
d09b3a21
authored
Aug 26, 2019
by
gaoming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nice
parent
4632b860
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
4 deletions
+45
-4
admin.py
like/admin.py
+16
-0
0008_auto_20190814_1422.py
like/migrations/0008_auto_20190814_1422.py
+17
-0
models.py
like/models.py
+12
-1
views.py
like/views.py
+0
-3
No files found.
like/admin.py
View file @
d09b3a21
from
django.contrib
import
admin
from
like.models
import
PromotionInfo
,
PromotionChannel
# Register your models here.
class
PromotionInfoAdmin
(
admin
.
ModelAdmin
):
pass
class
PromotionChannelAdmin
(
admin
.
ModelAdmin
):
list_display
=
(
"appid"
,
"idfa"
,
"imei"
,
"create_time"
,
"active_time"
)
list_filter
=
(
"appid"
,
'create_time'
,
'active_time'
)
search_fields
=
[
'appid'
,
'idfa'
,
'imei'
]
admin
.
site
.
register
(
PromotionInfo
,
PromotionInfoAdmin
)
admin
.
site
.
register
(
PromotionChannel
,
PromotionChannelAdmin
)
like/migrations/0008_auto_20190814_1422.py
0 → 100644
View file @
d09b3a21
# Generated by Django 2.2.1 on 2019-08-14 14:22
from
django.db
import
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'like'
,
'0007_auto_20190812_1128'
),
]
operations
=
[
migrations
.
AlterUniqueTogether
(
name
=
'promotionchannel'
,
unique_together
=
{(
'device_id'
,
'appid'
,
'idfa'
,
'idfv'
,
'imei'
)},
),
]
like/models.py
View file @
d09b3a21
...
...
@@ -18,7 +18,6 @@ from channels.HermesEnum import(
CHANNEL_STATUS
,
)
class
PromotionInfo
(
models
.
Model
):
'''
渠道商信息表
...
...
@@ -35,6 +34,12 @@ class PromotionInfo(models.Model):
app
=
models
.
CharField
(
max_length
=
8
,
verbose_name
=
"app名称"
,
default
=
"gengmei"
)
appendtime
=
models
.
DateField
(
auto_now_add
=
True
,
verbose_name
=
"创建时间"
)
def
__unicode__
(
self
):
return
self
.
name
def
__str__
(
self
):
return
self
.
name
class
PromotionChannel
(
models
.
Model
):
class
Meta
:
unique_together
=
(
'device_id'
,
'appid'
,
'idfa'
,
'idfv'
,
'imei'
)
...
...
@@ -80,6 +85,12 @@ class PromotionChannel(models.Model):
active_time
=
models
.
DateTimeField
(
null
=
True
,
blank
=
True
,
verbose_name
=
u'激活时间'
)
last_activity
=
models
.
DateTimeField
(
auto_now
=
True
,
verbose_name
=
u'最后活跃时间'
)
def
__unicode__
(
self
):
return
self
.
appid
def
__str__
(
self
):
return
self
.
appid
def
save
(
self
,
data
=
None
,
*
args
,
**
kwargs
):
...
...
like/views.py
View file @
d09b3a21
...
...
@@ -48,9 +48,6 @@ class Statistic(View):
}
return
JsonResponse
(
result
)
def
post
(
self
,
request
):
data
=
request
.
POST
.
dict
()
...
...
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