def findValleys(self,window = 30, delta = 3 ):
        minimum = np.Inf
        width = int(window/2.0)
        peaks = []

        for index,val in enumerate(self):
            #peak found
            if val < minimum:
                minimum = val
                minpos = index
            #checking whether peak satisfies window and delta conditions
            if min( self[max(0, index-width):index+width])-delta > minimum:
                peaks.append((minpos, minimum))
                minimum = np.Inf
        return peaks
Return this in the post method of your view class.
dataset/ETHPy150Open sightmachine/SimpleCV/SimpleCV/LineScan.py/LineScan.findValleys--crossover with--dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/hqwebapp/views.py/CRUDPaginatedViewMixin.paginate_crud_response