Commit b535be91 authored by lixiaofang's avatar lixiaofang

add

parent e70ec638
......@@ -51,7 +51,9 @@ def get_topic_product_info(topic_id):
def get_pictorial_tag_by_id(pictorial_id):
try:
tag_id_list = list(PictorialTag.objects.filter(pictorial_id=pictorial_id, is_online=True, is_collection=1).values_list("tag_id", flat=True))
tag_id_list = list(
PictorialTag.objects.filter(pictorial_id=pictorial_id, is_online=True, is_collection=1).values_list(
"tag_id", flat=True))
return tag_id_list
except:
......@@ -76,13 +78,13 @@ def get_pictorial_tag_by_id(pictorial_id):
# return []
def get_recomment_data():
def get_edit_comment():
try:
last = Topic.objects.count() - 1
index1 = randint(0, last)
MyObj1 = Topic.objects.all()[index1]
index_data = Topic.objects.all()[index1]
return index_data.type_id
except:
logging.error("catch exception,err_msg:%s" % traceback.format_exc())
return []
return -1
import pymysql
import traceback
import logging
from vest.request.auto_request import login, time_conv, get_comment, reply, get_product_comment, get_face_comment
from vest.request.auto_request import login, time_conv, get_comment, reply, get_product_comment, get_face_comment, \
get_edit_comment
from vest.request.auto_request import host, user, db, passwd
from libs.error import logging_exception
from vest.data.topic_models import get_edit_tag_id_list, get_pictorial_tag_by_id, get_topic_product_info, \
......@@ -71,8 +72,10 @@ def true_comment_one():
# 先判断是不是编辑标签
edit_judge = get_edit_tag_id_list(i[1])
if len(edit_judge) > 0:
# 如果有编辑标签
rand_tag_id = random.randint(0, len(edit_judge) - 1)
comment = get_comment()
# 去拿他的所属分类 根据分类去拿对应的标签
comment = get_edit_comment()
else:
# 判断有没有商品信息
product_judge = get_topic_product_info(i[1])
......@@ -83,7 +86,7 @@ def true_comment_one():
face_judge = topic_has_image(i[1])
if face_judge:
comment = get_face_comment()
#原始评论
# 原始评论
else:
comment = get_comment()
......
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