<commit_before>from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect

# Create your views here.from django.http import HttpResponse


def index(request):
    return HttpResponse("Hello, world. You're at the BIG TABLE.")


def clindate(request, clindate):
    (year, month, day) = clindate.split("-")

    return HttpResponse("Clinic date %s" % year+" "+month+" "+day)


def patient(request, pt_uuid):
    return HttpResponse("You're looking at patient %s" % pt_uuid)


def intake(request):
    from . import forms as myforms

    # if this is a POST request we need to process the form data
    if request.method == 'POST':
        # create a form instance and populate it with data from the request:
        form = myforms.PatientForm(request.POST)
        # check whether it's valid:
        if form.is_valid():
            # process the data in form.cleaned_data as required
            # ...
            # redirect to a new URL:
            return HttpResponseRedirect('/')

    # if a GET (or any other method) we'll create a blank form<commit_msg>Set up redirect at db saves for new patients.<commit_after>from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
from django.core.urlresolvers import reverse

from . import models as mymodels

# Create your views here.from django.http import HttpResponse


def index(request):
    return HttpResponse("Hello, world. You're at the BIG TABLE.")


def clindate(request, clindate):
    (year, month, day) = clindate.split("-")

    return HttpResponse("Clinic date %s" % year+" "+month+" "+day)


def patient(request, pt_uuid):
    return HttpResponse("You're looking at patient %s" % pt_uuid)


def intake(request):
    from . import forms as myforms

    # if this is a POST request we need to process the form data
    if request.method == 'POST':
        # create a form instance and populate it with data from the request:
        form = myforms.PatientForm(request.POST)
        # check whether it's valid:
        if form.is_valid():
            p = mymodels.Patient(**form.cleaned_data)
            p.save()

            # redirect to a new URL:
            return HttpResponseRedirect(reverse(patient, args=(p.id,)))

    # if a GET (or any other method) we'll create a blank form
{'fraction_non_alphanumeric': 0.0935344827586207, 'fraction_numerical': 0.0, 'mean_word_length': 3.07908611599297, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1151952', 'n_tokens_mistral': 664, 'n_tokens_neox': 626, 'n_words': 251}