Commits

Ruslan Keba  committed 449b828

event.absolute_uri as url for sharing (in social networks)

  • Participants
  • Parent commits 9aaed3f

Comments (0)

Files changed (1)

 from django.db import models
 from django.db.models import permalink
 from django.utils.safestring import mark_safe
+from django.contrib.sites.models import Site
 
 from gfm import gfm
 from dates import humanized_date
     def get_absolute_url(self):
         return 'djclub.views.event', (self.date_begin.year, self.id)
 
+    def get_absolute_uri(self):
+        return u'http://{0}{1}'.format(Site.objects.get_current().domain, self.get_absolute_url())
+
+    absolute_uri = property(get_absolute_uri)
+
     def summary_html(self):
         if self.markup == self.MARKUP_GFM:
             return mark_safe(gfm(self.summary))