pylib: add getListHostnames to database helper