def add_browser request form AddBrowserForm request POST if form is_va

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
def add_browser(request):
form = AddBrowserForm(request.POST)
if form.is_valid():
name = form.cleaned_data.get('name')
version = form.cleaned_data.get('version')
Browser.objects.get_or_create(name=name, version=version)
all = Browser.objects.all()
return render_to_response("add_browser.html", {'form': form, 'all': all})