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
1ff1946b
Commit
1ff1946b
authored
May 22, 2019
by
王浩
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'haow/batch_create_topic' into 'master'
fix topic batch create get content See merge request
!50
parents
d044d3e3
d9df8fd3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
topic.py
api/views/topic.py
+4
-4
No files found.
api/views/topic.py
View file @
1ff1946b
...
@@ -123,12 +123,12 @@ class CreateTopicForBatch(BaseView):
...
@@ -123,12 +123,12 @@ 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>'
content
=
content
.
replace
(
'#'
+
tag_name
,
alpha_tag
)
content
=
content
.
replace
(
'#'
+
tag_name
,
alpha_tag
)
item
[
"content"
]
=
content
.
replace
(
'#'
,
''
)
item
.
get
(
"content"
)
=
content
.
replace
(
'#'
,
''
)
item
[
"tag_ids"
]
=
[
item
[
"tag_ids"
]
=
[
_tag_data
[
tag_name
]
_tag_data
[
tag_name
]
...
@@ -212,12 +212,12 @@ class CreateTopicForBatchByOne(BaseView):
...
@@ -212,12 +212,12 @@ 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>'
content
=
content
.
replace
(
'#'
+
tag_name
,
alpha_tag
)
content
=
content
.
replace
(
'#'
+
tag_name
,
alpha_tag
)
item
[
"content"
]
=
content
.
replace
(
'#'
,
''
)
item
.
get
(
"content"
)
=
content
.
replace
(
'#'
,
''
)
item
[
"tag_ids"
]
=
[
item
[
"tag_ids"
]
=
[
_tag_data
[
tag_name
]
_tag_data
[
tag_name
]
...
...
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