0
Hi, I’m making a search bar with filters, in it the user can choose whether to sort by frequency or sort by another field (which is ordering everything right), what gives problem is when searching by frequency, that in the case will count how many times certain food was registered and will show all but ordered from the most frequent to the least frequent.
I’m trying to figure it out this way:
queryset = Compras.objects.values('comidas').annotate(c=Count('comidas')).order_by('c')
When I put to print in the terminal there appears ordered, but when I try to access the server and do the search gives the error NoReverseMatch
. The can is wrong?