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
钟尚武
physical
Commits
eea2f48e
Commit
eea2f48e
authored
May 31, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改获取数据的大
parent
c7543fdf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
4 deletions
+1
-4
search_hotword.py
search/views/search_hotword.py
+1
-4
No files found.
search/views/search_hotword.py
View file @
eea2f48e
...
...
@@ -37,7 +37,7 @@ def search_hotword(device_id=-1):
# 获取符合条件的核心词
results_tag
=
Tag
.
objects
.
filter
(
is_online
=
True
,
collection
=
1
)
.
count
()
tag_id
=
random
.
sample
(
range
(
1
,
results_registr_tag
),
1
)
tag_id
=
random
.
sample
(
range
(
1
,
results_registr_tag
),
6
)
results_tag_chose
=
Tag
.
objects
.
filter
(
id__in
=
tag_id
)
.
values_list
(
"name"
,
flat
=
True
)
for
i
in
results_tag_chose
:
all_tag_name_list
.
add
(
i
)
...
...
@@ -52,9 +52,6 @@ def search_hotword(device_id=-1):
all_tag_name_list
.
add
(
results_tag_recommend
[
0
])
if
len
(
all_tag_name_list
)
==
12
:
return
{
"recommend_tag_name"
:
list
(
all_tag_name_list
)}
logging
.
info
(
"get all_tag_name_list02:
%
s"
%
all_tag_name_list
)
# 取不够数则取核心标签
if
len
(
all_tag_name_list
)
<
12
:
for
i
in
range
(
0
,
12
):
...
...
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