Commit 33fdc40f authored by lixiaofang's avatar lixiaofang

add

parent a3f673c4
......@@ -111,7 +111,7 @@ class Topic(models.Model):
tag_name_list = list()
logging.info("get tag_id_list :%s" % tag_id_list)
for i in range(0, len(tag_name_list), 1000):
query_results = Tag.objects.filter(id__in=tag_id_list[i:i + 1000]).values_list("name", flat=True)
query_results = Tag.objects.filter(id__in=tag_id_list[i:i + 1000])
for item in query_results:
tag_name_list.append(item)
return tag_name_list
......
......@@ -63,7 +63,7 @@ class User(models.Model):
follow_user_id_list.append(user_follow.follow_id)
follow_user_detail_list = list()
for i in range(0, len(follow_user_id_list), 1000):
sql_data_list = User.objects.filter(user_id__in=follow_user_id_list[i:i+1000]).values("user_id","country_id")
sql_data_list = User.objects.filter(user_id__in=follow_user_id_list[i:i+1000])
for detail_data in sql_data_list:
item = {
"user_id": detail_data.user_id,
......@@ -76,7 +76,7 @@ class User(models.Model):
def get_attention_group_id_list(self):
try:
attention_group_id_list = list()
query_results = GroupUserRole.objects.filter(is_online=True, user_id=self.user_id).values("group_id","update_time")
query_results = GroupUserRole.objects.filter(is_online=True, user_id=self.user_id)
for item in query_results:
item_dict = {
"group_id": item.group_id,
......@@ -97,7 +97,7 @@ class User(models.Model):
pick_user_id_list = []
for i in range(0, len(pick_topic_id_list), 1000):
topic_sql_list = Topic.objects.filter(id__in=pick_topic_id_list[i:i+1000]).values("user_id")
topic_sql_list = Topic.objects.filter(id__in=pick_topic_id_list[i:i+1000])
for topic_data in topic_sql_list:
pick_user_id_list.append(topic_data.user_id)
......@@ -105,7 +105,7 @@ class User(models.Model):
pick_user_detail_list = list()
for i in range(0, len(pick_user_id_list), 1000):
sql_data_list = User.objects.filter(user_id__in=pick_user_id_list[i:i+1000]).values("user_id","country_id")
sql_data_list = User.objects.filter(user_id__in=pick_user_id_list[i:i+1000])
for detail_data in sql_data_list:
item = {
"user_id": detail_data.user_id,
......@@ -126,7 +126,7 @@ class User(models.Model):
same_group_detail_list = list()
for i in range(0, len(same_group_user_id_list), 1000):
sql_data_list = User.objects.filter(user_id__in=same_group_user_id_list[i:i+1000]).values("user_id","country_id")
sql_data_list = User.objects.filter(user_id__in=same_group_user_id_list[i:i+1000])
for detail_data in sql_data_list:
item = {
"user_id": detail_data.user_id,
......@@ -140,7 +140,7 @@ class User(models.Model):
try:
user_tag_id_list = list()
query_results = AccountUserTag.objects.filter(user=self.user_id, is_deleted=False).values("tag_id")
query_results = AccountUserTag.objects.filter(user=self.user_id, is_deleted=False)
for item in query_results:
user_tag_id_list.append(item.tag_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