28 lines
651 B
Python
28 lines
651 B
Python
# wish/views.py
|
|
|
|
from django.views.generic import ListView, DetailView, UpdateView
|
|
|
|
from .models import Wish, Wishlist
|
|
|
|
|
|
class WishListList(ListView):
|
|
context_object_name = 'wishlists'
|
|
model = Wishlist
|
|
template_name = 'wish/list.html'
|
|
|
|
class WishListDetail(DetailView):
|
|
context_object_name = 'wishlist'
|
|
model = Wishlist
|
|
template_name = 'wish/list_detail.html'
|
|
|
|
class WishDetail(DetailView):
|
|
context_object_name = 'wish'
|
|
model = Wish
|
|
template_name = 'wish/wish_detail.html'
|
|
|
|
class UpdateWishView(UpdateView):
|
|
model = Wish
|
|
fields = ('name', 'description')
|
|
template_name = 'wish/wish_update.html'
|
|
|