qrurls/models.py
changeset 78 7e40b1d2be3e
parent 77 40e91c2d4579
child 80 3aaac91a6654
--- a/qrurls/models.py	Fri Sep 06 01:25:16 2013 +0300
+++ b/qrurls/models.py	Fri Sep 06 01:34:25 2013 +0300
@@ -218,6 +218,12 @@
         # XXX: this asumes that URLImage is never changed after publishing..
         return self.published
 
+    def title (self) :
+        if self.image and self.image.title.strip() :
+            return self.image.title
+        else :
+            return self.shorturl.title
+    
     def __unicode__ (self) :
         return u"{published_state} {url}".format(
                 published_state=self.published_state(),