View for a single trial.

def trial(request):
    """View for a single trial."""
    job_id = request.GET.get("job_id")
    trial_id = request.GET.get("trial_id")
    recent_trials = TrialRecord.objects \
        .filter(job_id=job_id) \
        .order_by("-start_time")
    recent_results = ResultRecord.objects \
        .filter(trial_id=trial_id) \
        .order_by("-date")[0:2000]
    current_trial = TrialRecord.objects \
        .filter(trial_id=trial_id) \
        .order_by("-start_time")[0]
    context = {
        "job_id": job_id,
        "trial_id": trial_id,
        "current_trial": current_trial,
        "recent_results": recent_results,
        "recent_trials": recent_trials
    }
    return render(request, "trial.html", context)