def add_view(request): form = MovieForm() if request.method == 'POST': form = MovieForm(request.POST) if form.is_valid(): form.save() return movie_home_view(request) return render(request, 'testapp/add.html', {'form': form})
def addmovie_view(request): form = MovieForm() if request.method=='POST': form = MovieForm(request.POST) if form.is_valid(): form.save(commit=True) return base_view(request) return render(request, 'testapp/add_movie.html',{'form1':form})
def h2(request): form = MovieForm() if request.method == "POST": form = MovieForm(request.POST) if form.is_valid(): form.save() return h1(request) return render(request, "testapp/addmovie.html", {"form": form})
def add_movie_view(request): form = MovieForm() if request.method == 'POST': form = MovieForm(request.POST) if form.is_valid(): form.save() return index_view(request) return render(request, 'addmovie.html', {'form': form})
def addmovie(request): form = MovieForm() if request.method == "POST": form = MovieForm(request.POST) if form.is_valid(): form.save(commit=True) return index(request) return render(request, 'testapp/addmovie.html', {'form': form})
def add_movie_view(request): form = MovieForm() if request.method == 'POST': form = MovieForm(request.POST) if form.is_valid(): form.save() print('SUCCESSFULL') return index_view(request) return render(request, 'testapp/addmovie.html', {'form': form})