def enter_judge(request):
    if request.method == 'POST':
        form = JudgeForm(request.POST)
        if form.is_valid():
            try:
                form.save()
            except __HOLE__:
                return render_to_response('error.html',
                                         {'error_type': "Judge",
                                          'error_name': "["+cd['name']+"]",
                                          'error_info': "Judge Cannot Validate!"},
                                          context_instance=RequestContext(request))
            return render_to_response('thanks.html',
                                     {'data_type': "Judge",
                                      'data_name': "["+form.cleaned_data['name']+"]",
                                      'data_modification': "CREATED",
                                      'enter_again': True},
                                      context_instance=RequestContext(request))
    else:
        form = JudgeForm(first_entry=True)
    return render_to_response('data_entry.html',
                              {'form': form, 'title': "Create Judge"},
                              context_instance=RequestContext(request))
dataset/ETHPy150Open jolynch/mit-tab/mittab/apps/tab/judge_views.py/enter_judge