[FIX] orm/models: correct wrong port of upstream changes in merge 14f135a