You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wish/wishlist/views.py

24 lines
608 B
Python

from django.shortcuts import render
import wishlist.models as m
import django.views.generic as dv
class WishedItemView(dv.DetailView):
model = m.WishedItem
template_name = 'wishlist/item.html'
class UserWishLists(dv.ListView):
model = m.WishList
template_name = 'wishlist/userwishlists.html'
def get_queryset(self):
qs = super().get_queryset()
return qs.filter(owner__login=self.loginname)
class WishListView(dv.ListView):
model = m.WishedItem
template_name = 'wishlist/wishlist.html'
def get_queryset(self):
qs = super().get_queryset()
return qs.filter(wishlists__slug__in=[self.slug])