def start_semester_view(request):
    """
    Initiates a semester"s worth of workshift, with the option to copy
    workshift types from the previous semester.
    """
    page_name = "Start Semester"
    year, season = utils.get_year_season()
    start_date, end_date = utils.get_semester_start_end(year, season)

    semester_form = SemesterForm(
        data=request.POST or None,
        initial={
            "year": year,
            "season": season,
            "start_date": start_date.strftime(date_formats[0]),
            "end_date": end_date.strftime(date_formats[0]),
        },
        prefix="semester",
    )

    pool_forms = []
    try:
        prev_semester = Semester.objects.latest("end_date")
    except Semester.DoesNotExist:
        pass
    else:
        pools = WorkshiftPool.objects.filter(
            semester=prev_semester,
            is_primary=False,
        )
        for pool in pools:
            form = StartPoolForm(
                data=request.POST or None,
                initial={
                    "title": pool.title,
                    "hours": pool.hours,
                },
                prefix="pool-{}".format(pool.pk),
            )
            pool_forms.append(form)

    if semester_form.is_valid() and all(i.is_valid() for i in pool_forms):
        # And save this semester
        semester = semester_form.save()
        for pool_form in pool_forms:
            pool_form.save(semester=semester)
        return HttpResponseRedirect(wurl("workshift:manage",
                                         sem_url=semester.sem_url))

    return render_to_response("start_semester.html", {
        "page_name": page_name,
        "semester_form": semester_form,
        "pool_forms": pool_forms,
    }, context_instance=RequestContext(request))
Initiates a semester"s worth of workshift, with the option to copy
    workshift types from the previous semester.