ORM integration with template