diff options
Diffstat (limited to 'app/links/models.py')
-rw-r--r-- | app/links/models.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/links/models.py b/app/links/models.py index c6b502c..11a6798 100644 --- a/app/links/models.py +++ b/app/links/models.py @@ -1,4 +1,5 @@ import datetime +from django.utils.encoding import force_text from django.db import models from django.contrib.sitemaps import Sitemap from django.contrib.syndication.views import Feed @@ -52,6 +53,11 @@ class Link(models.Model): def comment_period_open(self): return self.enable_comments and datetime.datetime.today() - datetime.timedelta(30) <= self.pub_date + def admin_link(self): + return force_text('<a href="%s">Visit Site</a>' % (self.url)) + admin_link.allow_tags = True + admin_link.short_description = 'Link' + class LinkSitemap(Sitemap): changefreq = "never" |