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
4bd4da57
Commit
4bd4da57
authored
Aug 23, 2019
by
段英荣
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'vest_debug' into 'master'
add See merge request
alpha/physical!439
parents
f5c12622
310c6e8d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
topic_models.py
vest/data/topic_models.py
+9
-4
No files found.
vest/data/topic_models.py
View file @
4bd4da57
...
...
@@ -11,9 +11,12 @@ from django.db import models
def
get_edit_tag_id_list
(
topic_id
):
try
:
tag_id_list
=
TopicTag
.
objects
.
using
(
settings
.
SLAVE_DB_NAME
)
.
filter
(
topic_id
=
topic_id
,
tag_id_list
=
list
(
TopicTag
.
objects
.
using
(
settings
.
SLAVE_DB_NAME
)
.
filter
(
topic_id
=
topic_id
,
is_collection
=
1
)
.
values_list
(
"tag_id"
,
flat
=
True
)
flat
=
True
))
logging
.
info
(
"get ---tag_id_list:
%
s"
%
tag_id_list
)
logging
.
info
(
"get ---topic_id:
%
s"
%
topic_id
)
return
tag_id_list
except
:
logging
.
error
(
"catch exception,err_msg:
%
s"
%
traceback
.
format_exc
())
...
...
@@ -82,9 +85,11 @@ def get_category_tag_id(edit_tag_list):
try
:
logging
.
info
(
"get -----------"
)
# 拿到搜索的分类
all_category_tag_list
=
CommunityCategoryTagRelation
.
objects
.
filter
(
tag_id__in
=
edit_tag_list
,
is_online
=
True
,
all_category_tag_list
=
list
(
CommunityCategoryTagRelation
.
objects
.
filter
(
tag_id__in
=
edit_tag_list
,
is_online
=
True
,
is_deleted
=
False
)
.
values_list
(
"category_tag_id"
,
flat
=
True
)
"category_tag_id"
,
flat
=
True
))
if
len
(
all_category_tag_list
)
>
0
:
index
=
randint
(
0
,
len
(
all_category_tag_list
)
-
1
)
...
...
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