Display leaf_model_name in unicode when appropriate
Change-Id: I72e1523af910e0730ff4249652729f9477a27c32
diff --git a/xos/core/models/attic/xosbase_model.py b/xos/core/models/attic/xosbase_model.py
index 49df01f..8a45a05 100644
--- a/xos/core/models/attic/xosbase_model.py
+++ b/xos/core/models/attic/xosbase_model.py
@@ -126,7 +126,10 @@
if hasattr(self, "name") and self.name:
return u'%s' % self.name
elif hasattr(self, "id") and self.id:
- return u'%s-%s' % (self.__class__.__name__, self.id)
+ if hasattr(self, "leaf_model_name") and self.leaf_model_name:
+ return u'%s-%s' % (self.leaf_model_name, self.id)
+ else:
+ return u'%s-%s' % (self.__class__.__name__, self.id)
else:
return u'%s-unsaved' % self.__class__.__name__