aboutsummaryrefslogtreecommitdiffstats
path: root/ryuslash/aggregator/models.py
diff options
context:
space:
mode:
authorGravatar Tom Willemse2013-05-22 23:46:09 +0200
committerGravatar Tom Willemse2013-05-22 23:46:09 +0200
commitd394b2c40ee94394679700e5ff2858e1c95c7262 (patch)
treebd15438d214eefa15d55f56d4cb2b5d04361e4f5 /ryuslash/aggregator/models.py
parentc4684123b3323a9a61fe1eea5b3228086bfcb8ee (diff)
downloadryuslash.org-d394b2c40ee94394679700e5ff2858e1c95c7262.tar.gz
ryuslash.org-d394b2c40ee94394679700e5ff2858e1c95c7262.zip
Add Feed to the database
Instead of specifying the feeds to use in the `local_settings.py' file specify them with the django admin interface. This means that the `django.contrib.admin', `django.contrib.auth' and all their dependencies have been added to the project.
Diffstat (limited to 'ryuslash/aggregator/models.py')
-rw-r--r--ryuslash/aggregator/models.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/ryuslash/aggregator/models.py b/ryuslash/aggregator/models.py
index ac3d278..3ca7df2 100644
--- a/ryuslash/aggregator/models.py
+++ b/ryuslash/aggregator/models.py
@@ -1,14 +1,30 @@
from django.db import models
+
+class Feed(models.Model):
+ name = models.CharField(max_length=300)
+ base_url = models.URLField()
+ feed_url = models.CharField(max_length=100)
+ favicon_ext = models.CharField(max_length=10, default='ico')
+ uses_markdown = models.BooleanField()
+ uses_titles = models.BooleanField()
+ convert_newlines = models.BooleanField()
+ category = models.SmallIntegerField(choices=((0, 'post'),
+ (1, 'activity')))
+
+ def __unicode__(self):
+ return self.name
+
+
class Post(models.Model):
post_id = models.CharField(max_length=255, unique=True,
primary_key=True)
title = models.CharField(max_length=500, blank=True)
- category = models.CharField(max_length=255)
link = models.URLField(max_length=255)
updated = models.DateTimeField()
content = models.TextField()
icon = models.CharField(max_length=255)
+ feed = models.ForeignKey(Feed)
class Meta:
- ordering = [ '-updated' ]
+ ordering = ['-updated']