[Fixed]-Django 1.8 : Filter query_set in overriden method get_query_set() of ModelAdmin

1👍

filter does not mutate the queryset it is called on, it returns a new one. You need to return that new queryset:

def get_queryset(self, request):
    qs = super(PropositionDonAdmin,self).get_queryset(request)
    qs = qs.filter(donateur = None)
    return qs

Leave a comment