Correct Code example to fit API v8.0

When using this code as is, the 'ids' variable throws an exception for not being defined. In the new API, 'ids' is no longer given as a function variable but as a variable within 'self'. Right?