save related attributes in Template model