function to slice the queryset according to the display length

        :param queryset: Django Queryset: filtered and ordered queryset result
        :param kwargs: dict: query dict sent by data tables package
        :return: queryset: result after slicing

def slicing(queryset, **kwargs):
        """
        function to slice the queryset according to the display length

        :param queryset: Django Queryset: filtered and ordered queryset result
        :param kwargs: dict: query dict sent by data tables package
        :return: queryset: result after slicing
        """
        # if the length is -1, we need to display all the records
        # otherwise, just slicing the queryset
        length = ensure(int, kwargs.get('length', [0])[0], 0)
        start = ensure(int, kwargs.get('start', [0])[0], 0)
        if length >= 0:
            queryset = queryset[start:start + length]
        return queryset