def get_queryset(self):
q_list = []
users_folows_list = Follow.objects.filter(user=self.request.user)
for follow in users_folows_list:
q_list.append(Q(fromAddress=follow.address, timestamp__gte=follow.created.timestamp()))
q_list.append(Q(toAddress=follow.address, timestamp__gte=follow.created.timestamp()))
if q_list:
query = q_list.pop()
for item in q_list:
query |= item
return EthTransactions.objects.filter(query)
return EthTransactions.objects.none()
评论列表
文章目录