diff options
author | Shweta Chaughule <shwettach@gmail.com> | 2012-04-16 18:28:30 +0530 |
---|---|---|
committer | Shweta Chaughule <shwettach@gmail.com> | 2012-04-16 18:28:30 +0530 |
commit | fdf62a8f3cf1d5e6d00d4450cb5a930d6448a944 (patch) | |
tree | c3c1ff0b4fa6abe6f4f1aed72ae6a4e8b0867fc9 /gstudio/models.py | |
parent | 39467038c61056769e91e16c80130214c9811ada (diff) | |
download | gnowsys-fdf62a8f3cf1d5e6d00d4450cb5a930d6448a944.tar.gz |
Reftype property updated in models file
Diffstat (limited to 'gstudio/models.py')
-rw-r--r-- | gstudio/models.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gstudio/models.py b/gstudio/models.py index 80b57d1..d793db0 100644 --- a/gstudio/models.py +++ b/gstudio/models.py @@ -252,6 +252,23 @@ class NID(models.Model): return None return vrs.object + + @property + def reftype(self): + """ + Returns the type the id belongs to. + """ + try: + """ + ALGO: simple wrapper for the __class__.__name__ so that it can be used in templates + """ + obj = self.ref + return obj.__class__.__name__ + + except: + return None + + @property def get_edit_url(self): |