Commit a6185e1b authored by Michal Čihař's avatar Michal Čihař

Views for browsing checks (issue #15)

parent df953593
......@@ -8,7 +8,8 @@ from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotAllow
from django.contrib import messages
from django.contrib.auth.decorators import login_required, permission_required
from django.contrib.auth.models import AnonymousUser
from django.db.models import Q
from django.db.models import Q, Count
from trans.models import Project, SubProject, Translation, Unit, Suggestion, Check, Dictionary, Change
from lang.models import Language
......@@ -53,6 +54,19 @@ def home(request):
'usertranslations': usertranslations,
}))
def show_checks(request):
return render_to_response('checks.html', RequestContext(request, {
'checks': Check.objects.values('check').annotate(count = Count('id')),
'title': _('Checks'),
}))
def show_check(request, name):
obj = get_object_or_404(Check, check = name)
return render_to_response('check.html', RequestContext(request, {
'object': obj,
}))
def show_languages(request):
return render_to_response('languages.html', RequestContext(request, {
'languages': Language.objects.all(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment