Last active
June 29, 2019 08:41
-
-
Save aballah-chamakh/0a1c681128e0ccee3a6e712968529881 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.shortcuts import render | |
from django.views.generic import ListView,DetailView,CreateView,UpdateView,DeleteView | |
from .models import Product | |
from .forms import ProductForm | |
class ProductListView(ListView): | |
queryset = Product.objects.all() | |
template_name = 'product_view.html' | |
class ProductDetaiView(DetailView): | |
model = Porduct | |
template_name = 'product_detail.html' | |
class ProductCreateView(CreateView): | |
model = Product | |
form_class = PorductForm | |
template_name = 'product_create.html' | |
success_url = '/' | |
class ProductUpdateView(UpdateView): | |
model = Product | |
form_class= PorductForm | |
template_name = 'product_update.html' | |
success_url = '/' | |
class ProductDeleteView(UpdateView): | |
model = Product | |
template_name = 'product_delete.html' | |
success_url = '/' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment