diff options
author | luxagraf <sng@luxagraf.net> | 2016-12-13 10:46:00 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2016-12-13 10:46:00 -0500 |
commit | 88fd02951dd0cdd376757516f5b350ca8e82dd7b (patch) | |
tree | aeab53885f5f409f13518f8cfb60e425dc182b47 /app/resume/models.py | |
parent | 4d14de514c4260df0d034280a59468081d1966c9 (diff) |
made the pub item menu display better
Diffstat (limited to 'app/resume/models.py')
-rw-r--r-- | app/resume/models.py | 6 |
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) |