views.py 308 Bytes
from django.shortcuts import render
from django.db.models import Count
from .models import RT_edu

# Create your views here.

def test(request):
    educations = RT_edu.objects.values('city').annotate(ct=Count('city'))
    context = {'educations': educations}
    return render(request, 'test.html', context)