Cloned DMOJ

This commit is contained in:
thanhluong 2020-01-21 15:35:58 +09:00
parent f623974b58
commit 49dc9ff10c
513 changed files with 132349 additions and 39 deletions

18
judge/views/language.py Normal file
View file

@ -0,0 +1,18 @@
from django.utils.translation import gettext_lazy
from django.views.generic import ListView
from judge.models import Language
from judge.utils.views import TitleMixin
class LanguageList(TitleMixin, ListView):
model = Language
context_object_name = 'languages'
template_name = 'status/language-list.html'
title = gettext_lazy('Runtimes')
def get_queryset(self):
queryset = super().get_queryset().prefetch_related('runtimeversion_set')
if not self.request.user.is_superuser and not self.request.user.is_staff:
queryset = queryset.filter(judges__online=True).distinct()
return queryset