Break a Query into windows on a given column.

def windowed_query(q, column, windowsize):
    """"
    Break a Query into windows on a given column.
    """

    for whereclause in column_windows(q.session, column, windowsize):
        for row in q.filter(whereclause).order_by(column):
            yield row