Create dict:
Warehouse_data = {
    'Warehouse1': {
           1: {'value': 123, 'cost': D('213.22')},
           2: {'value': 1244, 'cost': D('2323.32')},
           3: {'value': 231, 'cost': 'No price'},
    },
    ....
    'default': {
    ...
    }
}
and then use Warehouse_data.get(warehouse.name, 'default')