(self, key)
Translates slice notation on a `ListObject` instance into ``limit``
        and ``offset`` filter parameters.
Translates slice notation on a `ListObject` instance into ``limit``
        and ``offset`` filter parameters.
Translates slice notation on a ListObject instance into limit and offset filter parameters .
def __getitem__(self, key):
        """Translates slice notation on a `ListObject` instance into ``limit``
        and ``offset`` filter parameters."""
        if isinstance(key, slice):
            args = dict()
            if key.start is not None:
                args['offset'] = key.start
                if key.stop is not None:
                    args['limit'] = key.stop - key.start
            elif key.stop is not None:
                args['limit'] = key.stop
            return self.filter(**args)

        try:
            getitem = super(PageObject, self).__getitem__
        except AttributeError:
            raise TypeError("'%s' object is unsubscriptable except by slices"
                % (type(self).__name__,))
        else:
            return getitem(key)
def __getitem__ ( self , key ) : if isinstance ( key , slice ) : args = dict ( ) if key . start is not None : args [ 'offset' ] = key . start if key . stop is not None : args [ 'limit' ] = key . stop - key . start elif key . stop is not None : args [ 'limit' ] = key . stop return self . filter ( * * args ) try : getitem = super ( PageObject , self ) . __getitem__ except AttributeError : raise TypeError ( "'%s' object is unsubscriptable except by slices" % ( type ( self ) . __name__ , ) ) else : return getitem ( key )