public
Last active

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
# list_detail.object_list replacement with all the things I need
 
def object_list(request, queryset, extra_context=None,
template_name='', paginate_by=None):
class ObjectList(ListView):
def post(self, request, *args, **kwargs):
return self.get(request, *args, **kwargs)
 
def get_context_data(self, **kwargs):
c = super(ObjectList, self).get_context_data(**kwargs)
c.update(extra_context)
return c
 
return ObjectList.as_view(template_name=template_name,
paginate_by=paginate_by,
queryset=queryset)(request)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.