'Modify query to filter request by state.'

def filter(self, trans, user, query, column_filter):

    if (column_filter == 'All'):
        return query
    if column_filter:
        return query.join(model.RequestEvent.table).filter((self.model_class.table.c.id == model.RequestEvent.table.c.request_id)).filter((model.RequestEvent.table.c.state == column_filter)).filter(model.RequestEvent.table.c.id.in_(select(columns=[func.max(model.RequestEvent.table.c.id)], from_obj=model.RequestEvent.table, group_by=model.RequestEvent.table.c.request_id)))
