from django.shortcuts import *
import traceback
import json
from judge.models import Contest


def api_contest_list(request):
    js = {}
    for c in Contest.objects.filter(is_public=True):
        js[c.key] = {
            'name': c.name,
            'free_start': c.free_start,
            "start_time": c.start_time,
            "time_limit": c.time_limit,
            "ongoing": c.ongoing
        }
    jso = json.dumps(js)
    return HttpResponse(jso, mimetype='application/json')

@@ -86,16 +86,67 @@
 Contest%0A
+from judge.templatetags.timedelta import nice_repr%0A
 %0A%0Adef ap
@@ -337,17 +337,17 @@
         
-%22
+'
 start_ti
@@ -348,17 +348,17 @@
 art_time
-%22
+'
 : c.star
@@ -377,17 +377,17 @@
         
-%22
+'
 time_lim
@@ -388,19 +388,29 @@
 me_limit
-%22
+'
 : 
+nice_repr(
 c.time_l
@@ -414,16 +414,28 @@
 e_limit,
+ 'concise'),
 %0A       
@@ -443,17 +443,17 @@
     
-%22
+'
 ongoing
-%22
+'
 : c.

Stringify timedelta