from django views generic list_detail import object_list def generic_w

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
from django.views.generic.list_detail import object_list
def generic_wrapper(request):
"""
Extract the articles based on the logged-in
user information.
"""
if request.user.is_anonymous():
qs = Articles.objects.get_default_articles()
else:
qs = Articles.objects.filter(user = request.username)
return object_list(request, qs)