# Path: test_projects/django18/pizzagigi/views.py
# class PizzaCreateView(CreateView):
# 
#     model = Pizza
#     fields = ['toppings']
#     success_url = reverse_lazy('pizza:created')
# 
# class PizzaDeleteView(DeleteView):
# 
#     model = Pizza
#     success_url = reverse_lazy('pizza:deleted')
# 
#     def get_success_url(self):
#         return force_text(self.success_url)
# 
# class PizzaDetailView(DetailView):
# 
#     model = Pizza
# 
# class PizzaListView(ListView):
# 
#     queryset = Pizza.objects.order_by('-id')
#     context_object_name = 'pizzas'
#     paginate_by = 10
# 
# class PizzaUpdateView(UpdateView):
# 
#     model = Pizza
#     fields = ['toppings']
#     success_url = reverse_lazy('pizza:updated')


from django.conf.urls import patterns, url
from django.views.generic import TemplateView
from .views import (
    PizzaCreateView, PizzaDeleteView, PizzaDetailView, PizzaListView,
    PizzaUpdateView
)


urlpatterns = patterns('',  # NOQA

    url(r'^$', PizzaListView.as_view(), name='list'),
    url(r'^create/$', PizzaCreateView.as_view(), name='create'),
    url(r'^created/$', TemplateView.as_view(
        template_name='pizzagigi/pizza_created.html'), name='created'),

# Path: test_projects/django18/pizzagigi/views.py
# class PizzaCreateView(CreateView):
# 
#     model = Pizza
#     fields = ['toppings']
#     success_url = reverse_lazy('pizza:created')
# 
# class PizzaDeleteView(DeleteView):
# 
#     model = Pizza
#     success_url = reverse_lazy('pizza:deleted')
# 
#     def get_success_url(self):
#         return force_text(self.success_url)
# 
# class PizzaDetailView(DetailView):
# 
#     model = Pizza
# 
# class PizzaListView(ListView):
# 
#     queryset = Pizza.objects.order_by('-id')
#     context_object_name = 'pizzas'
#     paginate_by = 10
# 
# class PizzaUpdateView(UpdateView):
# 
#     model = Pizza
#     fields = ['toppings']
#     success_url = reverse_lazy('pizza:updated')


# Path: test_projects/django18/pizzagigi/urls.py
from django.conf.urls import patterns, url
from django.views.generic import TemplateView
from .views import (
    PizzaCreateView, PizzaDeleteView, PizzaDetailView, PizzaListView,
    PizzaUpdateView
)



urlpatterns = patterns('',  # NOQA

    url(r'^$', PizzaListView.as_view(), name='list'),
    url(r'^create/$', PizzaCreateView.as_view(), name='create'),
    url(r'^created/$', TemplateView.as_view(
        template_name='pizzagigi/pizza_created.html'), name='created'),

    url(r'^detail/(?P<pk>[0-9]*)$', PizzaDetailView.as_view(), name='detail'),