def get_queryset(self, request):
        """
        Add number of photos to each gallery.
        """
        qs = super(GalleryAdmin, self).get_queryset(request)
        return qs.annotate(photo_count=Count('photos'))
def get_queryset(self, request):
        """
        Add number of photos to each gallery.
        """
        qs = super(GalleryAdmin, self).get_queryset(request)
        return qs.annotate(photo_count=Count('photos'))
def get_queryset ( self , request ) : qs = super ( GalleryAdmin , self ) . get_queryset ( request ) return qs . annotate ( photo_count = Count ( 'photos' ) )
Add number of photos to each gallery.
Add number of photos to each gallery .