I have a table with Cars where are makes and models in one place. Make Models
I want to create a simple request for get Makes list grouped by Make.
I tried make = Car.objects.values('make').annotate(Count('id')) but I has an error 'dict' object has no attribute '_meta'
asked 19 Jul, 07:00
make = Car.objects.values('make').annotate(Count('id'))
data = json.dumps(list(make))
return HttpResponse(data, mimetype='application/json')
answered 19 Jul, 08:00