|
|
@ -1,4 +1,5 @@
|
|
|
|
from django.shortcuts import render, get_object_or_404
|
|
|
|
from django.shortcuts import render, get_object_or_404
|
|
|
|
|
|
|
|
from django.contrib.auth import get_user_model
|
|
|
|
import wishlist.models as m
|
|
|
|
import wishlist.models as m
|
|
|
|
import django.views.generic as dv
|
|
|
|
import django.views.generic as dv
|
|
|
|
|
|
|
|
|
|
|
@ -17,11 +18,12 @@ class UserWishLists(dv.ListView):
|
|
|
|
|
|
|
|
|
|
|
|
def get_queryset(self):
|
|
|
|
def get_queryset(self):
|
|
|
|
qs = super().get_queryset()
|
|
|
|
qs = super().get_queryset()
|
|
|
|
return qs.filter(owner__login=self.loginname)
|
|
|
|
return qs.filter(owner__username=self.kwargs['loginname'])
|
|
|
|
|
|
|
|
|
|
|
|
def get_context_data(self, **kwargs):
|
|
|
|
def get_context_data(self, **kwargs):
|
|
|
|
ctx = super().get_context_data(**kwargs)
|
|
|
|
ctx = super().get_context_data(**kwargs)
|
|
|
|
ctx['page_title'] = f"{ctx['object']}'s wishlists"
|
|
|
|
user = get_object_or_404(get_user_model(), username=self.kwargs['loginname'])
|
|
|
|
|
|
|
|
ctx['page_title'] = f"{user}'s wishlists"
|
|
|
|
return ctx
|
|
|
|
return ctx
|
|
|
|
|
|
|
|
|
|
|
|
class WishListView(dv.ListView):
|
|
|
|
class WishListView(dv.ListView):
|
|
|
|