Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
physical
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
alpha
physical
Commits
5c62173d
Commit
5c62173d
authored
Apr 12, 2019
by
Kai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
537bad5c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
collect_data.py
linucb/views/collect_data.py
+6
-1
tag.py
trans2es/models/tag.py
+3
-0
No files found.
linucb/views/collect_data.py
View file @
5c62173d
...
...
@@ -155,6 +155,10 @@ class CollectData(object):
tag_list
=
list
()
click_topic_tag_list
=
list
()
collection_tag_sql_query_results
=
TopicTag
.
objects
.
using
(
settings
.
SLAVE_DB_NAME
)
.
filter
(
topic_id
=
topic_id
)
.
values_list
(
"tag_id"
,
"is_online"
,
"is_collection"
)
for
tag_id
,
is_online
,
is_collection
in
collection_tag_sql_query_results
:
if
is_online
and
is_collection
:
click_topic_tag_list
.
append
(
tag_id
)
click_sql_query_results
=
TopicTag
.
objects
.
using
(
settings
.
SLAVE_DB_NAME
)
.
filter
(
topic_id
=
topic_id
)
.
values_list
(
"tag_id"
,
"is_online"
)
for
tag_id
,
is_online
in
click_sql_query_results
:
...
...
@@ -163,9 +167,10 @@ class CollectData(object):
tag_sql_query_results
=
Tag
.
objects
.
using
(
settings
.
SLAVE_DB_NAME
)
.
filter
(
id
=
tag_id
)
.
values_list
(
"id"
,
"collection"
,
"is_ai"
)
for
id
,
collection
,
is_ai
in
tag_sql_query_results
:
if
collection
==
1
or
is_ai
==
1
:
if
(
collection
==
1
or
is_ai
==
1
)
and
id
not
in
click_topic_tag_list
:
click_topic_tag_list
.
append
(
id
)
is_click
=
1
is_vote
=
0
...
...
trans2es/models/tag.py
View file @
5c62173d
...
...
@@ -19,6 +19,9 @@ class TopicTag(models.Model):
tag_id
=
models
.
IntegerField
(
verbose_name
=
u"标签ID"
)
topic_id
=
models
.
IntegerField
(
verbose_name
=
u"帖子ID"
)
is_online
=
models
.
BooleanField
(
verbose_name
=
u"是否在线"
)
is_collection
=
models
.
BooleanField
(
verbose_name
=
u"是否编辑标签"
)
class
AccountUserTag
(
models
.
Model
):
...
...
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