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
9ff71e49
Commit
9ff71e49
authored
Jun 12, 2019
by
王浩
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'haow/pin_crawl' into 'test'
fix code See merge request
!62
parents
d47ce628
582a2898
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
topic.py
api/views/topic.py
+10
-3
No files found.
api/views/topic.py
View file @
9ff71e49
...
@@ -54,6 +54,8 @@ class CreateTopicForBatch(BaseView):
...
@@ -54,6 +54,8 @@ 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
.
get
(
"content"
)
content
=
item
.
get
(
"content"
)
if
not
tag_data
:
continue
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>'
...
@@ -167,8 +169,9 @@ class CreateTopicForBatch(BaseView):
...
@@ -167,8 +169,9 @@ class CreateTopicForBatch(BaseView):
item
[
"is_online"
]
=
is_online
item
[
"is_online"
]
=
is_online
item
[
"pictorial_tag_ids"
]
=
pictorial_tag_ids
item
[
"pictorial_tag_ids"
]
=
pictorial_tag_ids
if
item
.
get
(
"location"
)
and
item
.
get
(
"location"
)
.
get
(
"name"
):
if
item
.
get
(
"location"
)
and
item
.
get
(
"location"
)
.
get
(
"name"
):
_tag_error
,
_location_tag_data
=
self
.
batch_create_tags
(
tags
=
tags
,
is_location
=
1
,
is_own
=
1
)
_tag_error
,
_location_tag_data
=
self
.
batch_create_tags
(
tags
=
[
item
.
get
(
"location"
)
.
get
(
"name"
)],
is_location
=
1
,
is_own
=
1
)
location_tags
.
append
(
_location_tag_data
)
if
_location_tag_data
:
location_tags
.
append
(
_location_tag_data
)
not_exists_ids
,
topic_list
,
cache_key
=
self
.
check_exist_ids
(
topics
=
topics
,
platform
=
platform
)
not_exists_ids
,
topic_list
,
cache_key
=
self
.
check_exist_ids
(
topics
=
topics
,
platform
=
platform
)
...
@@ -178,10 +181,14 @@ class CreateTopicForBatch(BaseView):
...
@@ -178,10 +181,14 @@ class CreateTopicForBatch(BaseView):
# 先创建标签
# 先创建标签
_tag_error
,
_tag_data
=
self
.
batch_create_tags
(
tags
=
tags
,
is_own
=
1
)
_tag_error
,
_tag_data
=
self
.
batch_create_tags
(
tags
=
tags
,
is_own
=
1
)
if
not
_tag_data
:
_tag_data
=
{}
# 地域标签
# 地域标签
if
location_tags
:
if
location_tags
:
_tag_data
=
_tag_data
.
extend
(
location_tags
)
info_logger
.
info
({
'location_tags'
:
location_tags
})
for
item
in
location_tags
:
_tag_data
.
update
(
item
)
# 更新发帖
# 更新发帖
# 处理标签,将文本中的标签处理成现有标签
# 处理标签,将文本中的标签处理成现有标签
...
...
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