

def get(self, request, *args, **kwargs):
    self.object_list = self.get_queryset()
    allow_empty = self.get_allow_empty()
    if (not allow_empty):
        if ((self.get_paginate_by(self.object_list) is not None) and hasattr(self.object_list, 'exists')):
            is_empty = (not self.object_list.exists())
        else:
            is_empty = (len(self.object_list) == 0)
        if is_empty:
            raise Http404((_("Empty list and '%(class_name)s.allow_empty' is False.") % {
                'class_name': self.__class__.__name__,
            }))
    context = self.get_context_data(object_list=self.object_list)
    return self.render_to_response(context)

dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/views/generic/list.py BaseListView.get/original