handle relations in show mode

fix #306

porting the configuration for show templates from the orm admin.
I agree that this code can be rewritten to be more (re)usable.