How to add an annotation on distinct items?

Solution with added "distinct=True" on annotate. This solution undocumented on django documantations

Example :

 packages = Package.objects.annotate(bid_count=Count('items__bids', distinct = True)) 

Source :   stackoverflow.com