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
777b3945
Commit
777b3945
authored
Mar 22, 2019
by
段英荣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
modify
parent
df8e929d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
collect_data.py
linucb/views/collect_data.py
+11
-11
No files found.
linucb/views/collect_data.py
View file @
777b3945
...
...
@@ -99,9 +99,9 @@ class CollectData(object):
tag_list
=
list
()
click_sql_query_results
=
TopicTag
.
objects
.
using
(
settings
.
SLAVE_DB_NAME
)
.
filter
(
topic_id
=
topic_id
)
.
values_list
(
"tag_id"
,
"is_online"
)
for
sql_item
in
click_sql_query_results
:
if
sql_item
.
is_online
:
tag_list
.
append
(
sql_item
.
tag_id
)
for
tag_id
,
is_online
in
click_sql_query_results
:
if
is_online
:
tag_list
.
append
(
tag_id
)
is_click
=
1
is_vote
=
0
...
...
@@ -136,14 +136,14 @@ class CollectData(object):
topic_tag_id_dict
=
dict
()
tag_list
=
list
()
exposure_sql_query_results
=
TopicTag
.
objects
.
using
(
settings
.
SLAVE_DB_NAME
)
.
filter
(
topic_id__in
=
exposure_topic_id_list
)
.
values_list
(
"tag_id"
,
"is_online"
)
for
sql_item
in
exposure_sql_query_results
:
if
sql_item
.
is_online
:
tag_list
.
append
(
sql_item
.
tag_id
)
if
sql_item
.
topic_id
not
in
topic_tag_id_dict
:
topic_tag_id_dict
[
sql_item
.
topic_id
]
=
list
()
topic_tag_id_dict
[
sql_item
.
topic_id
]
.
append
(
sql_item
.
tag_id
)
exposure_sql_query_results
=
TopicTag
.
objects
.
using
(
settings
.
SLAVE_DB_NAME
)
.
filter
(
topic_id__in
=
exposure_topic_id_list
)
.
values_list
(
"t
opic_id"
,
"t
ag_id"
,
"is_online"
)
for
topic_id
,
tag_id
,
is_online
in
exposure_sql_query_results
:
if
is_online
:
tag_list
.
append
(
tag_id
)
if
topic_id
not
in
topic_tag_id_dict
:
topic_tag_id_dict
[
topic_id
]
=
list
()
topic_tag_id_dict
[
topic_id
]
.
append
(
tag_id
)
is_click
=
0
is_vote
=
0
...
...
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