diff options
author | Tom Willemse | 2013-05-23 00:35:46 +0200 |
---|---|---|
committer | Tom Willemse | 2013-05-23 00:39:41 +0200 |
commit | c14ccf7079c8d68473e80df9c20aaac735f69447 (patch) | |
tree | ba2f807fd16aa606d5e624b33ae065d96ffb426d /ryuslash/aggregator/models.py | |
parent | 91283adebd1531fc7e676fcd29734b46a989525f (diff) | |
download | ryuslash.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.py | 7 |
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 |