[Answer]-Django admin filter data after selection

1👍

The most simple way is to implement author selection as a form with submit type GET and check the request.GET inside ModelAdmin class

<form method="GET">
   <select name="author">
        <option>An author</option>
   </select>
</form>

def get_queryset(self, request):
    author = request.GET['author']
    qs = super(BooksList, self).get_queryset(request)           
    return qs.filter(author=author)

Leave a comment