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

Function get_name

tests_python/my_django_proj_17/my_app/views.py:30–46  ·  view source on GitHub ↗
(request)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

is_validMethod · 0.80
NameFormClass · 0.70

Tested by

no test coverage detected