CORD-1594: Tag models with information about the leaf model, for casting
generic instances into specialized ones

Change-Id: I7b0f283b11380363742a284dc794bf3914e81fc9
diff --git a/lib/xos-genx/xosgenx/targets/service.xtarget b/lib/xos-genx/xosgenx/targets/service.xtarget
index a48abb7..80d90d6 100644
--- a/lib/xos-genx/xosgenx/targets/service.xtarget
+++ b/lib/xos-genx/xosgenx/targets/service.xtarget
@@ -61,6 +61,9 @@
 
   # Generated methods
   def save(self, *args, **kwds):
+      if not self.leaf_model_name:
+          self.leaf_model_name = "{{ m.name }}"
+
       try:
           self.__xos_save_base(*args, **kwds)
       except AttributeError: