Create a gist now

Instantly share code, notes, and snippets.

# 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment