Commit 2be7f285 authored by 段英荣's avatar 段英荣

modify

parent f4bc89a5
...@@ -18,8 +18,8 @@ class UserFollow(models.Model): ...@@ -18,8 +18,8 @@ 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="userFollow",verbose_name="关注用户信息") user = models.ForeignKey(User,related_name="userFollow",verbose_name="关注用户信息")
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="是否上线")
is_deleted = models.BooleanField(verbose_name="是否删除") is_deleted = models.BooleanField(verbose_name="是否删除")
......
...@@ -248,7 +248,8 @@ def get_type_info_map(): ...@@ -248,7 +248,8 @@ def get_type_info_map():
name = "user", #用户 name = "user", #用户
type="user", type="user",
model=user.User, model=user.User,
query_deferred=lambda:user.User.objects.prefetch_related("userFollow").query, #query_deferred=lambda:user.User.objects.prefetch_related("userFollow").query,
query_deferred=lambda: user.User.objects.prefetch_related("userFollow").query,
get_data_func=UserTransfer.get_user_data, get_data_func=UserTransfer.get_user_data,
bulk_insert_chunk_size=100, bulk_insert_chunk_size=100,
round_insert_chunk_size=5, 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