Beispiel #1
0
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})
Beispiel #2
0
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})
Beispiel #3
0
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})
Beispiel #4
0
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})
Beispiel #5
0
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})
Beispiel #6
0
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})