[Answered ]-Display only unique records in django model admin form other model

2👍

You can use queryset() method in ModelAdmin class to filter what you want:

class BAdmin(admin.ModelAdmin):
    list_display = ('email', 'first_name', 'last_name', 'phone')

    def queryset(self, request):
        qs = super(BAdmin, self).queryset(request)
        qs = qs.distinct('email')

        return qs
👤Vinta

Leave a comment