[Fixed]-Django – check if list contains something in a template

2👍

request.user.trip_set.all is not a list but a queryset. I think it is the reason of your problem. You can try to change that into a list with the dictsort template filter.

{% if trip in request.user.trip_set.all|dictsort:"id" %}
👤luc

Leave a comment