diff options
author | Tom Willemse | 2013-05-22 23:46:09 +0200 |
---|---|---|
committer | Tom Willemse | 2013-05-22 23:46:09 +0200 |
commit | d394b2c40ee94394679700e5ff2858e1c95c7262 (patch) | |
tree | bd15438d214eefa15d55f56d4cb2b5d04361e4f5 /ryuslash/aggregator/views.py | |
parent | c4684123b3323a9a61fe1eea5b3228086bfcb8ee (diff) | |
download | ryuslash.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/views.py')
-rw-r--r-- | ryuslash/aggregator/views.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ryuslash/aggregator/views.py b/ryuslash/aggregator/views.py index 80eaadd..e16be11 100644 --- a/ryuslash/aggregator/views.py +++ b/ryuslash/aggregator/views.py @@ -5,9 +5,16 @@ from django.shortcuts import render from aggregator.models import Post +def _get_category(cat): + if cat == 'activity': + return 1 + else: + return 0 + + def posts(request, cat, page=1): - category = cat or 'post' - queryset = Post.objects.filter(category=category) + category = _get_category(cat) + queryset = Post.objects.filter(feed__category=category) paginator = Paginator(queryset, 20) if page is None: |