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
13664561
Commit
13664561
authored
Aug 30, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tag
parent
71d8e15d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
0 deletions
+16
-0
group.py
search/views/group.py
+5
-0
tag.py
search/views/tag.py
+0
-0
topic.py
search/views/topic.py
+0
-0
tag.py
trans2es/models/tag.py
+11
-0
No files found.
search/views/group.py
View file @
13664561
...
...
@@ -17,6 +17,7 @@ from trans2es.models.topic import CommunityCategoryTagRelation
from
trans2es.models.pictorial
import
PictorialTopics
from
trans2es.models.pictorial
import
CommunityPictorialActivity
from
alpha_types.venus
import
PICTORIAL_ACTIVITY_SORT
from
search.views.tag
import
get_same_tagset_ids
@bind
(
"physical/search/query_pictorial"
)
...
...
@@ -148,6 +149,10 @@ def pictorial_topic(topic_id=-1, offset=0, size=10):
for
item
in
result_dict
[
"hits"
]:
pict_pictorial_ids_list
=
item
[
"_source"
][
"pictorial_id"
]
topic_tag_list
=
item
[
"_source"
][
"tag_list"
]
##拿到这些标签的同义词
topic_tag_list
=
get_same_tagset_ids
(
topic_tag_list
)
##先拿到当前帖子对应的标签的分类ID
tag_type_ids
=
CommunityCategoryTagRelation
.
objects
.
filter
(
tag_id__in
=
topic_tag_list
,
is_online
=
True
,
is_deleted
=
False
)
.
values_list
(
...
...
search/views/tag.py
View file @
13664561
This diff is collapsed.
Click to expand it.
search/views/topic.py
View file @
13664561
This diff is collapsed.
Click to expand it.
trans2es/models/tag.py
View file @
13664561
...
...
@@ -107,4 +107,15 @@ class SettingsConfig(models.Model):
key
=
models
.
IntegerField
(
verbose_name
=
u"值"
)
val
=
models
.
IntegerField
(
verbose_name
=
"标签内容"
)
class
CommunityTagSetRelation
(
models
.
Model
):
class
Meta
:
verbose_name
=
"搜索热词"
db_table
=
"community_tag_set_relation"
id
=
models
.
IntegerField
(
primary_key
=
True
,
verbose_name
=
u"主键ID"
)
tag_id
=
models
.
IntegerField
(
verbose_name
=
u"标签ID"
)
tag_set_id
=
models
.
IntegerField
(
verbose_name
=
u"标签ID"
)
is_deleted
=
models
.
BooleanField
(
verbose_name
=
u"是否删除"
)
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