Commit 5073edcf authored by 段英荣's avatar 段英荣

modify

parent 6c96b6f8
...@@ -199,10 +199,13 @@ class Command(BaseCommand): ...@@ -199,10 +199,13 @@ class Command(BaseCommand):
def sync_tag_collecction_name_set(self): def sync_tag_collecction_name_set(self):
try: try:
collection_redis_key_name = "physical:official_tag_name_set" collection_redis_key_name = "physical:official_tag_name_set"
tag_list = TopicTag.objects.filter(is_online=True, is_collection=True).values_list("tag_id", flat=True) tag_list = list(TopicTag.objects.filter(is_online=True, is_collection=True).values_list("tag_id", flat=True))
for tag_id in tag_list:
tag_name = Tag.objects.filter(id=tag_id, is_online=True, is_deleted=False, logging.info("duan add,tag_list_len:%d" % len(tag_list))
is_category=False).values_list("name", flat=True) tag_name_list = Tag.objects.filter(id__in=tag_list, is_online=True, is_deleted=False,
is_category=False).values_list("name", flat=True)
for tag_name in tag_name_list:
if tag_name and len(tag_name)>0 and tag_name[0]: if tag_name and len(tag_name)>0 and tag_name[0]:
redis_client.sadd(collection_redis_key_name,tag_name[0]) redis_client.sadd(collection_redis_key_name,tag_name[0])
except: except:
......
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