Commit f7aed4c3 authored by martin0726's avatar martin0726

Created views for recipes model

I also added some corrections in the url file from the project folder
parent 18a5c1a4
...@@ -10,12 +10,26 @@ class IngredientsDetailView(generic.DetailView): ...@@ -10,12 +10,26 @@ class IngredientsDetailView(generic.DetailView):
template_name = 'ingredients_detail.html' template_name = 'ingredients_detail.html'
class IngredientsUpdateView(generic.Updateview): class IngredientsUpdateView(generic.UpdateView):
template_name = 'ingredients_update_form.html' template_name = 'ingredients_update_form.html'
class IngredientsCreateView(generic.CrateView): class IngredientsCreateView(generic.CreateView):
template_name = 'ingredients_create_form.html' template_name = 'ingredients_create_form.html'
class RecipesListView(generic.ListView):
template_name = 'recipes_list.html'
class RecipesDetailView(generic.DetailView):
template_name = 'recipes_detail.html'
class RecipesUpdateView(generic.UpdateView):
template_name = 'recipes_update_form.html'
class RecipesCreateView(generic.CreateView):
template_name = 'recipes_create_form.html'
# Create your views here. # Create your views here.
...@@ -13,7 +13,7 @@ Including another URLconf ...@@ -13,7 +13,7 @@ Including another URLconf
1. Import the include() function: from django.conf.urls import url, include 1. Import the include() function: from django.conf.urls import url, include
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
""" """
from django.conf.urls import url from django.conf.urls import include, url
from django.contrib import admin from django.contrib import admin
urlpatterns = [ urlpatterns = [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment