support model as array, generate name and ids