Add new function update_or_create for model