比如统计某个会员有多少条留言?
def follow_num(self):
num=Guestbook.objects.filter(user=self.pk,status=True).aggregate(c=Count('user__membername'))
return num['c']
比如统计某个会员有多少条留言?
def follow_num(self):
num=Guestbook.objects.filter(user=self.pk,status=True).aggregate(c=Count('user__membername'))
return num['c']