def stats_cast(request): data = bar_data(Person.objects.actors().only('name'), 'acted_in_count') return HttpResponse(enc.encode(data), content_type='application/json')
def stats_writers(request): data = bar_data(Person.objects.writers().only('name'), 'written_count') return HttpResponse(enc.encode(data), content_type='application/json')
def stats_keywords(request): data = bar_data(Keyword.objects.add_num_movies().only('name'), 'num_movies') return HttpResponse(enc.encode(data), content_type='application/json')