1👍
this is my solution:
in views.py
:
unread_messages=request.user.received_messages.filter(read_at__isnull=True,sender_deleted_at__isnull=True)
in template
:
{% for m in unread_messages %}
<!--do stuff-->
{% endfor %}
Source:stackexchange.com