The `id` parameter probably isn't an int or a long since it's being explicitly converted to an `int`. So the conditional ought go, just replace `id = int(id)` by `ids = [int(id)]` and pass `ids` to `read`.