summaryrefslogtreecommitdiff
path: root/app/resume
diff options
context:
space:
mode:
Diffstat (limited to 'app/resume')
-rw-r--r--app/resume/admin.py1
-rw-r--r--app/resume/models.py6
2 files changed, 7 insertions, 0 deletions
diff --git a/app/resume/admin.py b/app/resume/admin.py
index 0f8b71a..93b186e 100644
--- a/app/resume/admin.py
+++ b/app/resume/admin.py
@@ -8,6 +8,7 @@ class PublisherAdmin(admin.ModelAdmin):
class PubItemAdmin(admin.ModelAdmin):
+ list_display = ('title', 'pub_date', 'publisher', 'admin_link')
pass
admin.site.register(Publisher, PublisherAdmin)
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)