Commit 9a06fc96 authored by 段英荣's avatar 段英荣

modify

parent 82c0e56f
...@@ -24,7 +24,7 @@ class User(models.Model): ...@@ -24,7 +24,7 @@ class User(models.Model):
def get_follow_user_id_list(self): def get_follow_user_id_list(self):
follow_user_id_list = list() follow_user_id_list = list()
user_follows = self.userFollow.filter(is_online=True) user_follows = self.userfollow.filter(is_online=True)
for user_follow in user_follows: for user_follow in user_follows:
follow_user_id_list.append(user_follow.follow_id) follow_user_id_list.append(user_follow.follow_id)
......
...@@ -18,7 +18,7 @@ class UserFollow(models.Model): ...@@ -18,7 +18,7 @@ class UserFollow(models.Model):
app_label = 'api' app_label = 'api'
#user_id = models.IntegerField(verbose_name="用户ID") #user_id = models.IntegerField(verbose_name="用户ID")
user = models.ForeignKey(User,related_name=u"userFollow",verbose_name="关注用户信息",null=False) user = models.ForeignKey(User,related_name="userfollow",verbose_name="关注用户信息",null=False)
#user = models.ForeignKey(User, related_name='userFollow',on_delete=models.CASCADE) #user = models.ForeignKey(User, related_name='userFollow',on_delete=models.CASCADE)
follow_id = models.IntegerField(verbose_name="关注的用户ID") follow_id = models.IntegerField(verbose_name="关注的用户ID")
is_online = models.BooleanField(verbose_name="是否上线") is_online = models.BooleanField(verbose_name="是否上线")
......
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