summaryrefslogtreecommitdiff
path: root/app/resume/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/resume/models.py')
-rw-r--r--app/resume/models.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/resume/models.py b/app/resume/models.py
index 38f041a..c225d39 100644
--- a/app/resume/models.py
+++ b/app/resume/models.py
@@ -1,4 +1,5 @@
from django.db import models
+from django.utils.encoding import force_text
from django.core.urlresolvers import reverse
from utils.widgets import markdown_to_html
@@ -43,6 +44,11 @@ class PubItem(models.Model):
def get_absolute_url(self):
return reverse("resume:detail", kwargs={"publisher": self.publisher.slug, "slug": self.slug})
+ def admin_link(self):
+ return force_text('<a href="%s">Visit Site</a>' % (self.url))
+ admin_link.allow_tags = True
+ admin_link.short_description = 'Live Article'
+
def save(self, *args, **kwargs):
if self.body_markdown:
self.body_html = markdown_to_html(self.body_markdown)