Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
saturn
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
1
Merge Requests
1
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
saturn
Commits
554e53e7
Commit
554e53e7
authored
May 24, 2019
by
haowang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://git.wanmeizhensuo.com/alpha/saturn
into haow/pin_crawl
parents
b74db2b8
c996ed6f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
topic.py
api/views/topic.py
+3
-3
No files found.
api/views/topic.py
View file @
554e53e7
...
@@ -114,7 +114,7 @@ class CreateTopicForBatch(BaseView):
...
@@ -114,7 +114,7 @@ class CreateTopicForBatch(BaseView):
)
)
if
_tag_error
:
if
_tag_error
:
return
self
.
error
(
_tag_error
)
return
self
.
error
(
_tag_error
)
_tag_data
.
update
(
location_tags
)
#
_tag_data.update(location_tags)
# 更新发帖
# 更新发帖
# 处理标签,将文本中的标签处理成现有标签
# 处理标签,将文本中的标签处理成现有标签
...
@@ -125,7 +125,7 @@ class CreateTopicForBatch(BaseView):
...
@@ -125,7 +125,7 @@ class CreateTopicForBatch(BaseView):
#添加地域标签
#添加地域标签
if
item
.
get
(
"location"
)
and
item
.
get
(
"location"
)
.
get
(
"name"
):
if
item
.
get
(
"location"
)
and
item
.
get
(
"location"
)
.
get
(
"name"
):
tags
.
append
(
item
.
get
(
"location"
)
.
get
(
"name"
))
tags
.
append
(
item
.
get
(
"location"
)
.
get
(
"name"
))
content
=
item
[
"content"
]
content
=
item
.
get
(
"content"
)
for
tag_name
,
tag_id
in
_tag_data
.
items
():
for
tag_name
,
tag_id
in
_tag_data
.
items
():
if
tag_name
in
tags
:
if
tag_name
in
tags
:
alpha_tag
=
'<topic>{'
+
'"id":{},"name":"{}"'
.
format
(
tag_id
,
tag_name
)
+
'}</topic>'
alpha_tag
=
'<topic>{'
+
'"id":{},"name":"{}"'
.
format
(
tag_id
,
tag_name
)
+
'}</topic>'
...
@@ -214,7 +214,7 @@ class CreateTopicForBatchByOne(BaseView):
...
@@ -214,7 +214,7 @@ class CreateTopicForBatchByOne(BaseView):
for
item
in
need_create_topics
:
for
item
in
need_create_topics
:
tags
=
item
.
get
(
"tags"
)
or
[]
tags
=
item
.
get
(
"tags"
)
or
[]
tags
=
[
tag
.
replace
(
"#"
,
''
)
.
strip
()
for
tag
in
tags
]
tags
=
[
tag
.
replace
(
"#"
,
''
)
.
strip
()
for
tag
in
tags
]
content
=
item
[
"content"
]
content
=
item
.
get
(
"content"
)
for
tag_name
,
tag_id
in
_tag_data
.
items
():
for
tag_name
,
tag_id
in
_tag_data
.
items
():
if
tag_name
in
tags
:
if
tag_name
in
tags
:
alpha_tag
=
'<topic>{'
+
'"id":{},"name":"{}"'
.
format
(
tag_id
,
tag_name
)
+
'}</topic>'
alpha_tag
=
'<topic>{'
+
'"id":{},"name":"{}"'
.
format
(
tag_id
,
tag_name
)
+
'}</topic>'
...
...
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