Commit c9eb729f authored by 李小芳's avatar 李小芳

Merge branch 'mr/beta/dbmw' into 'master'

Mr/beta/dbmw

See merge request !35
parents 8971c2b0 182baaa0
......@@ -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)
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment