'Convert a BatchList object into format required for Layer1.'

def to_dict(self):

    d = {}
    for batch in self:
        b = batch.to_dict()
        if b['Keys']:
            d[batch.table.name] = b
    return d
