'distinct() method doesn't work with values() in Django

I am following Mosh's Django course, and I followed him step by step untill I get stack in this issue here, for him it works fine, but for me it doesn't work, I can't call distanct() method from values() why is that? I have searched in Django documentation and I found nothing I thought may they update it ,Igoogled it too but I haven't found an answer yet, could any one here help me ?

queryset = OrderItem.objects.values('product_id').distinct()



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source