aboutsummaryrefslogtreecommitdiffstats
path: root/ryuslash/aggregator/models.py
diff options
context:
space:
mode:
authorGravatar Tom Willemse2013-05-23 00:35:46 +0200
committerGravatar Tom Willemse2013-05-23 00:39:41 +0200
commitc14ccf7079c8d68473e80df9c20aaac735f69447 (patch)
treeba2f807fd16aa606d5e624b33ae065d96ffb426d /ryuslash/aggregator/models.py
parent91283adebd1531fc7e676fcd29734b46a989525f (diff)
downloadryuslash.org-c14ccf7079c8d68473e80df9c20aaac735f69447.tar.gz
ryuslash.org-c14ccf7079c8d68473e80df9c20aaac735f69447.zip
Add the all category and show feeds on page
Diffstat (limited to 'ryuslash/aggregator/models.py')
-rw-r--r--ryuslash/aggregator/models.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/ryuslash/aggregator/models.py b/ryuslash/aggregator/models.py
index 3ca7df2..9a39600 100644
--- a/ryuslash/aggregator/models.py
+++ b/ryuslash/aggregator/models.py
@@ -1,5 +1,7 @@
from django.db import models
+CATEGORIES = ['post', 'activity']
+
class Feed(models.Model):
name = models.CharField(max_length=300)
@@ -9,8 +11,9 @@ class Feed(models.Model):
uses_markdown = models.BooleanField()
uses_titles = models.BooleanField()
convert_newlines = models.BooleanField()
- category = models.SmallIntegerField(choices=((0, 'post'),
- (1, 'activity')))
+ category = models.SmallIntegerField(
+ choices=[(CATEGORIES.index(c), c) for c in CATEGORIES]
+ )
def __unicode__(self):
return self.name