Пример #1
0
def stats_cast(request):
    data = bar_data(Person.objects.actors().only('name'), 'acted_in_count')
    return HttpResponse(enc.encode(data), content_type='application/json')
Пример #2
0
def stats_writers(request):
    data = bar_data(Person.objects.writers().only('name'), 'written_count')
    return HttpResponse(enc.encode(data), content_type='application/json')
Пример #3
0
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')