diff options
author | luxagraf <sng@luxagraf.net> | 2015-12-23 12:59:48 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2015-12-23 12:59:48 -0500 |
commit | 1c5e35271ed54f0d5ea9d4a4ec9ebc39a345b429 (patch) | |
tree | 3de386bfaf5933395c5f09b0b0017ce9c90011b7 /app/links/models.py | |
parent | 06a306de30a78f8c0c0a38546c23605425d9d2d2 (diff) |
fixed some bugs in the links model
Diffstat (limited to 'app/links/models.py')
-rw-r--r-- | app/links/models.py | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/app/links/models.py b/app/links/models.py index a343604..0a82366 100644 --- a/app/links/models.py +++ b/app/links/models.py @@ -1,9 +1,7 @@ -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 from utils.widgets import markdown_to_html @@ -25,7 +23,7 @@ class Link(models.Model): class Meta: ordering = ['-pub_date'] - def __unicode__(self): + def __str__(self): return self.title def get_absolute_url(self): @@ -40,12 +38,6 @@ class Link(models.Model): def get_next_published(self): return self.get_next_by_pub_date(status__exact=1) - def get_thumbnail_url(self): - return "http://images.luxagraf.net/magnolia_thumbs/%s" % (self.screen_url) - - 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 @@ -61,13 +53,3 @@ class LinkSitemap(Sitemap): def lastmod(self, obj): return obj.pub_date - - -class LatestLinks(Feed): - title = "Luxagraf: Links" - link = "http://ma.gnolia.com/people/luxagraf/bookmarks" - description = "Links to interesting stuff" - description_template = 'feeds/links_description.html' - - def items(self): - return Link.objects.filter(status__exact=1).order_by('-pub_date')[:10] |