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
2b2f87fb
Commit
2b2f87fb
authored
Apr 11, 2019
by
Kai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
7e31a292
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
collect_data.py
linucb/views/collect_data.py
+9
-9
No files found.
linucb/views/collect_data.py
View file @
2b2f87fb
...
@@ -146,10 +146,10 @@ class CollectData(object):
...
@@ -146,10 +146,10 @@ class CollectData(object):
click_sql_query_results
=
TopicTag
.
objects
.
using
(
settings
.
SLAVE_DB_NAME
)
.
filter
(
topic_id
=
topic_id
)
.
values_list
(
"tag_id"
,
"is_online"
)
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
:
for
tag_id
,
is_online
in
click_sql_query_results
:
if
is_online
:
if
is_online
:
tag_sql_query_results
=
Tag
.
objects
.
using
(
settings
.
SLAVE_DB_NAME
)
.
filter
(
id
=
tag_id
)
.
values_list
(
"id"
,
"collection"
,
"is_ai"
)
#
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
:
#
for id,collection,is_ai in tag_sql_query_results:
if
collection
==
1
or
is_ai
==
1
:
#
if collection == 1 or is_ai == 1:
tag_list
.
append
(
id
)
tag_list
.
append
(
tag_
id
)
is_click
=
1
is_click
=
1
is_vote
=
0
is_vote
=
0
...
@@ -187,11 +187,11 @@ class CollectData(object):
...
@@ -187,11 +187,11 @@ class CollectData(object):
exposure_sql_query_results
=
TopicTag
.
objects
.
using
(
settings
.
SLAVE_DB_NAME
)
.
filter
(
topic_id__in
=
exposure_topic_id_list
)
.
values_list
(
"topic_id"
,
"tag_id"
,
"is_online"
)
exposure_sql_query_results
=
TopicTag
.
objects
.
using
(
settings
.
SLAVE_DB_NAME
)
.
filter
(
topic_id__in
=
exposure_topic_id_list
)
.
values_list
(
"topic_id"
,
"tag_id"
,
"is_online"
)
for
topic_id
,
tag_id
,
is_online
in
exposure_sql_query_results
:
for
topic_id
,
tag_id
,
is_online
in
exposure_sql_query_results
:
if
is_online
:
if
is_online
:
tag_sql_query_results
=
Tag
.
objects
.
using
(
settings
.
SLAVE_DB_NAME
)
.
filter
(
#
tag_sql_query_results = Tag.objects.using(settings.SLAVE_DB_NAME).filter(
id
=
tag_id
)
.
values_list
(
"id"
,
"collection"
,
"is_ai"
)
#
id=tag_id).values_list("id", "collection", "is_ai")
for
id
,
collection
,
is_ai
in
tag_sql_query_results
:
#
for id, collection, is_ai in tag_sql_query_results:
if
collection
==
1
or
is_ai
==
1
:
#
if collection == 1 or is_ai == 1:
tag_list
.
append
(
id
)
tag_list
.
append
(
tag_
id
)
if
topic_id
not
in
topic_tag_id_dict
:
if
topic_id
not
in
topic_tag_id_dict
:
topic_tag_id_dict
[
topic_id
]
=
list
()
topic_tag_id_dict
[
topic_id
]
=
list
()
...
...
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