'This method is always called first to initialize an iteration to the
first row of the table. The arguments come from the BestIndex() method
in the table object with constraintargs being a tuple of the
constraints you requested. If you always return None in BestIndex then
indexnum will be zero, indexstring will be None and constraintargs
will be empty).'

def Filter(self, indexnum, indexname, constraintargs):

    columns = indexname.split(',')
    column_to_value = dict(zip(columns, constraintargs))
    if ('parent' in column_to_value):
        initial_key = column_to_value['parent']
        data = self.get_data_for_key(initial_key)
    else:
        data = []
        for (i, key) in enumerate(self.db.keys()):
            key_type = self.db.type(key)
            if (key_type == 'string'):
                value = self.db.get(key)
            else:
                value = None
            data.append((i, key, value, None, key_type))
    self.data = data
    self.index = 0
    self.nrows = len(data)
