# Path: example/models.py
# class Post(models.Model):
#     title = models.CharField(max_length=100)
#     body = models.TextField(blank=True)
#     created = models.DateTimeField(auto_now_add=True)
# 
#     def __str__(self):
#         return self.title
# 
#     def get_absolute_url(self):
#         return reverse('post_detail', args=[str(self.id)])


from django.views.generic import DetailView, ListView, TemplateView, RedirectView
from .models import Post
# -*- coding: utf-8 -*-

from __future__ import unicode_literals



class IndexView(TemplateView):
    template_name = 'example/home.html'


class ErrorView(TemplateView):
    template_name = 'example/error.html'


class PostListView(ListView):
    model = Post
    paginate_by = 5
    context_object_name = 'post_list'
    template_name = 'example/post_list.html'


class PostDetailView(DetailView):

# Path: example/models.py
# class Post(models.Model):
#     title = models.CharField(max_length=100)
#     body = models.TextField(blank=True)
#     created = models.DateTimeField(auto_now_add=True)
# 
#     def __str__(self):
#         return self.title
# 
#     def get_absolute_url(self):
#         return reverse('post_detail', args=[str(self.id)])


# Path: example/views.py
from django.views.generic import DetailView, ListView, TemplateView, RedirectView
from .models import Post

# -*- coding: utf-8 -*-

from __future__ import unicode_literals



class IndexView(TemplateView):
    template_name = 'example/home.html'


class ErrorView(TemplateView):
    template_name = 'example/error.html'


class PostListView(ListView):
    model = Post
    paginate_by = 5
    context_object_name = 'post_list'
    template_name = 'example/post_list.html'


class PostDetailView(DetailView):

    model = Post