Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
mentha
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
rank
mentha
Commits
c9eb729f
Commit
c9eb729f
authored
Jan 20, 2021
by
李小芳
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'mr/beta/dbmw' into 'master'
Mr/beta/dbmw See merge request
!35
parents
8971c2b0
182baaa0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
15 deletions
+22
-15
transfer.py
data_sync/answer/transfer.py
+10
-7
transfer.py
data_sync/tractate/transfer.py
+12
-8
No files found.
data_sync/answer/transfer.py
View file @
c9eb729f
...
...
@@ -225,13 +225,16 @@ def get_answers(pks):
else
:
item
[
'selected_content_type'
]
=
-
1
else
:
result_data
=
alo_model
.
run
(
answer
.
content
)
item
[
'selected_content_type'
]
=
int
(
result_data
.
get
(
"content_type"
,
0
))
item
[
'selected_internet_celebrity'
]
=
[
list
(
item
.
keys
())[
0
]
for
item
in
result_data
.
get
(
"celebrity"
,
[])]
item
[
'selected_stars'
]
=
[
list
(
item
.
keys
())[
0
]
for
item
in
result_data
.
get
(
"star"
,
[])]
projects
=
[
list
(
item
.
keys
())[
0
]
for
item
in
result_data
.
get
(
"projects"
,
[])]
item
[
'portrait_tag_name'
]
.
extend
(
projects
)
try
:
result_data
=
alo_model
.
run
(
answer
.
content
)
item
[
'selected_content_type'
]
=
int
(
result_data
.
get
(
"content_type"
,
0
))
item
[
'selected_internet_celebrity'
]
=
[
list
(
item
.
keys
())[
0
]
for
item
in
result_data
.
get
(
"celebrity"
,
[])]
item
[
'selected_stars'
]
=
[
list
(
item
.
keys
())[
0
]
for
item
in
result_data
.
get
(
"star"
,
[])]
projects
=
[
list
(
item
.
keys
())[
0
]
for
item
in
result_data
.
get
(
"projects"
,
[])]
item
[
'portrait_tag_name'
]
.
extend
(
projects
)
except
:
pass
if
3315
in
item
[
'operators_add_tags'
]:
item
[
'new_smr'
]
=
answer
.
get_answer_newuser_smr
(
answer_id
=
answer
.
id
)
...
...
data_sync/tractate/transfer.py
View file @
c9eb729f
...
...
@@ -218,7 +218,8 @@ def get_tractate(pks):
+
item
[
'channel_tags_names'
]
+
item
[
'anecdote_tags'
]
+
item
[
"first_classify_names"
]
+
item
[
"second_classify_names"
]
+
operators_add_tags_names
)
tags_inter
=
list
(
set
(
tractate_all_tag_names
)
.
intersection
(
set
(
filter_tags_names
)))
tags_inter
=
[
item
for
item
in
list
(
set
(
tractate_all_tag_names
))
if
item
in
list
(
set
(
filter_tags_names
))]
# tags_inter = list(set(tractate_all_tag_names).intersection(set(filter_tags_names)))
if
tags_inter
:
item
[
'show_by_index'
]
=
2
# 2 标签中含有过滤列表中的标签
else
:
...
...
@@ -266,13 +267,16 @@ def get_tractate(pks):
else
:
item
[
'selected_content_type'
]
=
-
1
else
:
result_data
=
alo_model
.
run
(
tractate
.
content
)
item
[
'selected_content_type'
]
=
int
(
result_data
.
get
(
"content_type"
,
0
))
item
[
'selected_internet_celebrity'
]
=
[
list
(
item
.
keys
())[
0
]
for
item
in
result_data
.
get
(
"celebrity"
,
[])]
item
[
'selected_stars'
]
=
[
list
(
item
.
keys
())[
0
]
for
item
in
result_data
.
get
(
"star"
,
[])]
projects
=
[
list
(
item
.
keys
())[
0
]
for
item
in
result_data
.
get
(
"projects"
,
[])]
item
[
'portrait_tag_name'
]
.
extend
(
projects
)
try
:
result_data
=
alo_model
.
run
(
tractate
.
content
)
item
[
'selected_content_type'
]
=
int
(
result_data
.
get
(
"content_type"
,
0
))
item
[
'selected_internet_celebrity'
]
=
[
list
(
item
.
keys
())[
0
]
for
item
in
result_data
.
get
(
"celebrity"
,
[])]
item
[
'selected_stars'
]
=
[
list
(
item
.
keys
())[
0
]
for
item
in
result_data
.
get
(
"star"
,
[])]
projects
=
[
list
(
item
.
keys
())[
0
]
for
item
in
result_data
.
get
(
"projects"
,
[])]
item
[
'portrait_tag_name'
]
.
extend
(
projects
)
except
:
pass
if
"operators_add_tags"
in
item
and
3315
in
item
[
'operators_add_tags'
]:
item
[
'new_smr'
]
=
tractate
.
get_tractate_newuser_smr
(
tractate_id
=
tractate
.
id
)
...
...
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