from django.shortcuts import render, HttpResponse, redirect, reverse

from . models import Quote

from . forms import QuoteCreationForm

from django.views.generic.list import ListView


'''
def QuoteList(request):
    quotes = Quote.objects.all().order_by('-created_date')
    return render(request, 'blog/quotelist.html', {'quotelist': quotes })
'''

def QuoteCreationView(request):
 if request.method == "POST":
 	form = QuoteCreationForm(request.POST)
 	if form.is_valid():
 		form.save()
 		return redirect('blog:quotes')
 	else:
 		return redirect('blog:create')
 else:
 	form = QuoteCreationForm()
 return render(request, 'blog/create_quote.html', {'form':form })


class QuoteList(ListView):
	model = Quote
	paginate_by = 5
	template_name = 'blog/quotelist.html'
	context_object_name = 'quotelist'
4509717e98c6a2620a0779352411c889771a42b3
<mask token>

<mask token>


class QuoteList(ListView):
    <mask token>
    <mask token>
    <mask token>
    <mask token>

<mask token>


def QuoteCreationView(request):
    if request.method == 'POST':
        form = QuoteCreationForm(request.POST)
        if form.is_valid():
            form.save()
            return redirect('blog:quotes')
        else:
            return redirect('blog:create')
    else:
        form = QuoteCreationForm()
    return render(request, 'blog/create_quote.html', {'form': form})


class QuoteList(ListView):
    model = Quote
    paginate_by = 5
    template_name = 'blog/quotelist.html'
    context_object_name = 'quotelist'

from django.shortcuts import render, HttpResponse, redirect, reverse
from .models import Quote
from .forms import QuoteCreationForm
from django.views.generic.list import ListView
<mask token>


def QuoteCreationView(request):
    if request.method == 'POST':
        form = QuoteCreationForm(request.POST)
        if form.is_valid():
            form.save()
            return redirect('blog:quotes')
        else:
            return redirect('blog:create')
    else:
        form = QuoteCreationForm()
    return render(request, 'blog/create_quote.html', {'form': form})


class QuoteList(ListView):
    model = Quote
    paginate_by = 5
    template_name = 'blog/quotelist.html'
    context_object_name = 'quotelist'

from django.shortcuts import render, HttpResponse, redirect, reverse

from . models import Quote

from . forms import QuoteCreationForm

from django.views.generic.list import ListView


'''
def QuoteList(request):
    quotes = Quote.objects.all().order_by('-created_date')
    return render(request, 'blog/quotelist.html', {'quotelist': quotes })
'''

def QuoteCreationView(request):
 if request.method == "POST":
 	form = QuoteCreationForm(request.POST)
 	if form.is_valid():
 		form.save()
 		return redirect('blog:quotes')
 	else:
 		return redirect('blog:create')
 else:
 	form = QuoteCreationForm()
 return render(request, 'blog/create_quote.html', {'form':form })


class QuoteList(ListView):
	model = Quote
	paginate_by = 5
	template_name = 'blog/quotelist.html'
	context_object_name = 'quotelist'