def get_object(self, queryset=None):
        """
        Returns the object the view is displaying.

        By default this requires `self.queryset` and a `pk` or `slug` argument
        in the URLconf, but subclasses can override this to return any object.
        """
        # Use a custom queryset if provided; this is required for subclasses
        # like DateDetailView
        if queryset is None:
            queryset = self.get_queryset()
        
        pk = self.kwargs.get('pk', None)
        slug = self.kwargs.get('slug', None)
        try:
            if pk is not None:
                return queryset.get(pk=self.kwargs['pk'])
            elif slug is not None:
                slug_field = self.get_slug_field()
                return queryset.get(**{slug_field:self.kwargs['slug']})
            
        except (__HOLE__, IndexError):
            raise Http404(_(u"No %(verbose_name)s found matching the query") %
                          {'verbose_name': self.document._meta.verbose_name})
dataset/ETHPy150Open zbyte64/django-dockit/dockit/views/detail.py/SingleObjectMixin.get_object