2020-02-24 22:28:52 +00:00
|
|
|
from django.views.generic import DetailView, ListView
|
2020-02-13 21:07:28 +00:00
|
|
|
|
|
|
|
from .models import Wish
|
|
|
|
|
|
|
|
|
|
|
|
class WishListView(ListView):
|
|
|
|
model = Wish
|
|
|
|
template_name = "wish_list.html"
|
|
|
|
|
2020-05-09 12:24:15 +00:00
|
|
|
def get_queryset(self, **kwargs):
|
|
|
|
# only show unfulfilled wishes
|
|
|
|
return super().get_queryset().filter(fulfilled=False)
|
|
|
|
|
2020-02-13 21:07:28 +00:00
|
|
|
|
|
|
|
class WishDetailView(DetailView):
|
|
|
|
model = Wish
|
|
|
|
template_name = "wish_detail.html"
|
|
|
|
slug_url_kwarg = "wish_slug"
|