MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / get_name

Function get_name

tests_python/my_django_proj_21/my_app/views.py:32–50  ·  view source on GitHub ↗
(request)

Source from the content-addressed store, hash-verified

30
31
32def get_name(request):
33 import faulthandler
34 faulthandler.enable()
35 # if this is a POST request we need to process the form data
36 if request.method == 'POST':
37 # create a form instance and populate it with data from the request:
38 form = NameForm(request.POST)
39 # check whether it's valid:
40 if form.is_valid():
41 # process the data in form.cleaned_data as required
42 # ...
43 # redirect to a new URL:
44 return HttpResponseRedirect('/thanks/')
45
46 # if a GET (or any other method) we'll create a blank form
47 else:
48 form = NameForm(data={'your_name': 'unknown name'})
49
50 return render(request, 'my_app/name.html', {'form': form})
51
52
53def template_error(request):

Callers

nothing calls this directly

Calls 3

is_validMethod · 0.80
NameFormClass · 0.70
enableMethod · 0.45

Tested by

no test coverage detected