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.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/app/links/models.py b/app/links/models.py
index 4c3e59d..c6b502c 100644
--- a/app/links/models.py
+++ b/app/links/models.py
@@ -2,7 +2,7 @@ import datetime
from django.db import models
from django.contrib.sitemaps import Sitemap
from django.contrib.syndication.views import Feed
-from taggit.managers import TaggableManager
+from taggit.managers import TaggableManager
RATINGS = (
('1', "1 Star"),
@@ -12,8 +12,7 @@ RATINGS = (
('5', "5 Stars"),
)
-DEBUG = 1
-
+
class Link(models.Model):
link_id = models.CharField(max_length=60, blank=True, null=True)
title = models.CharField(max_length=400)
@@ -31,29 +30,29 @@ class Link(models.Model):
class Meta:
ordering = ['-pub_date']
-
+
def __unicode__(self):
return self.title
-
+
def get_absolute_url(self):
return self.url
-
+
def get_model_name(self):
return 'link'
-
+
def get_previous_published(self):
return self.get_previous_by_pub_date(status__exact=1)
-
+
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)
+ 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
-
-
+
+
class LinkSitemap(Sitemap):
changefreq = "never"
priority = 0.4
@@ -63,7 +62,8 @@ 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"