Commit 10fd6c18 authored by 段英荣's avatar 段英荣

modify

parent 3357cdf0
......@@ -23,4 +23,4 @@ class PickUserRecord(models.Model):
is_pick = models.BooleanField(verbose_name="is_pick")
create_time = models.DateTimeField(verbose_name=u'日记创建时间',default=datetime.datetime.fromtimestamp(0))
update_time = models.DateTimeField(verbose_name=u'日记更新时间', default=datetime.datetime.fromtimestamp(0))
#user = models.ForeignKey(User,related_name="user_pick",verbose_name="pick用户信息")
user = models.ForeignKey(User,related_name="user_pick",verbose_name="pick用户信息")
......@@ -25,7 +25,7 @@ class User(models.Model):
def get_follow_user_id_list(self):
print("********duan add,use attribute:%s" % str(dir(self)))
follow_user_id_list = list()
user_follows = self.userfollow.filter(is_online=True)
user_follows = self.myuserfollow.filter(is_online=True)
for user_follow in user_follows:
follow_user_id_list.append(user_follow.follow_id)
......
......@@ -18,7 +18,7 @@ class UserFollow(models.Model):
app_label = 'api'
#user_id = models.IntegerField(verbose_name="用户ID")
user = models.ForeignKey(User,related_name='userfollow',on_delete=models.CASCADE)
user = models.ForeignKey(User,related_name='myuserfollow',on_delete=models.CASCADE)
#user = models.ForeignKey(User, related_name='userFollow',on_delete=models.CASCADE)
follow_id = models.IntegerField(verbose_name="关注的用户ID")
is_online = models.BooleanField(verbose_name="是否上线")
......
......@@ -249,7 +249,7 @@ def get_type_info_map():
type="user",
model=user.User,
#query_deferred=lambda:user.User.objects.all().query,
query_deferred=lambda: user.User.objects.prefetch_related("userfollow").query,
query_deferred=lambda: user.User.objects.prefetch_related('myuserfollow').query,
get_data_func=UserTransfer.get_user_data,
bulk_insert_chunk_size=100,
round_insert_chunk_size=5,
......
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