summaryrefslogtreecommitdiff
path: root/app/links/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/links/models.py')
-rw-r--r--app/links/models.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/links/models.py b/app/links/models.py
index 11a6798..cdfd786 100644
--- a/app/links/models.py
+++ b/app/links/models.py
@@ -1,10 +1,13 @@
import datetime
+from django.core.urlresolvers import reverse
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
from taggit.managers import TaggableManager
+import markdown
+
RATINGS = (
('1', "1 Star"),
('2', "2 Stars"),
@@ -36,10 +39,10 @@ class Link(models.Model):
return self.title
def get_absolute_url(self):
- return self.url
+ return reverse("links:detail", kwargs={"slug": self.pk})
- def get_model_name(self):
- return 'link'
+ def render_description(self):
+ return markdown.markdown(self.description, extensions=['extra'], safe_mode=False)
def get_previous_published(self):
return self.get_previous_by_pub_date(status__exact=1)