比如统计某个会员有多少条留言?
def follow_num(self):
num=Guestbook.objects.filter(user=self.pk,status=True).aggregate(c=Count('user__membername'))
return num['c']
标签:__,self,num,user,aggregate,数量,统计 From: https://www.cnblogs.com/superip/p/17420420.html