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
5252683a
Commit
5252683a
authored
5 years ago
by
赵威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update logic
parent
4ab88b72
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
tag.py
search/views/tag.py
+13
-3
No files found.
search/views/tag.py
View file @
5252683a
...
...
@@ -146,9 +146,19 @@ def choice_pictorial_push_tag(device_id, user_id):
@bind
(
"physical/search/lintag_by_user_id"
)
def
get_lintags_by_user_id
(
user_id
):
res
=
AccountRegExtra
.
objects
.
filter
(
user_id
=
user_id
,
is_online
=
True
,
is_deleted
=
False
)
.
values_list
(
"device_id"
,
flat
=
True
)
print
(
res
)
return
{
"abc"
:
res
}
try
:
devices
=
AccountRegExtra
.
objects
.
filter
(
user_id
=
user_id
,
is_online
=
True
,
is_deleted
=
False
)
.
values_list
(
"device_id"
,
flat
=
True
)
if
devices
:
linucb_recommend_redis_prefix
=
"physical:linucb:tag_recommend:device_id:"
device_id
=
devices
[
0
]
tag_recommend_redis_key
=
linucb_recommend_redis_prefix
+
str
(
device_id
)
linucb_recommend_tag_data
=
redis_client
.
get
(
tag_recommend_redis_key
)
linucb_recommend_tag_list
=
json
.
loads
(
linucb_recommend_tag_data
[:
3
])
if
linucb_recommend_tag_data
else
[]
return
{
"lin_tag_list"
:
linucb_recommend_tag_list
}
return
{
"lin_tag_list"
:
[]}
except
Exception
as
e
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
return
{
"lin_tag_list"
:
[]}
@bind
(
"physical/search/choice_push_tag"
)
...
...
This diff is collapsed.
Click to expand it.
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