I am trying to order a queryset in the view. I get the following Error Message. Kindly help.
SELECT DISTINCT ON expressions must match initial ORDER BY expressions
models.py
class Op(models.Model):
operator = models.ForeignKey(Employee, null=False)
role = models.ForeignKey(Process, null=False)
views.py
op = Op.objects.all().distinct('operator').order_by('operator__employeename')