diff options
| author | Bobby <[email protected]> | 2022-09-25 00:56:00 -0400 |
|---|---|---|
| committer | Bobby <[email protected]> | 2022-09-25 00:56:00 -0400 |
| commit | 3f2fc550a7baf7bbd8d9045d4f2e1bcf41a209ff (patch) | |
| tree | f016d6721144eb6a6de31d7ac5747393dea5e8b6 /blog/context_processors.py | |
| parent | 46e0c0c700f3fc700952cbc9dad2f7e04719456b (diff) | |
| download | thatcomputerscientist-3f2fc550a7baf7bbd8d9045d4f2e1bcf41a209ff.tar.xz thatcomputerscientist-3f2fc550a7baf7bbd8d9045d4f2e1bcf41a209ff.zip | |
Major visual overhaul
Diffstat (limited to 'blog/context_processors.py')
| -rw-r--r-- | blog/context_processors.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/blog/context_processors.py b/blog/context_processors.py index 605fc0c5..7d2f7da0 100644 --- a/blog/context_processors.py +++ b/blog/context_processors.py @@ -1,13 +1,13 @@ from .models import Post, Category -def recent_posts(request): - recent_posts = Post.objects.filter(is_public=True).order_by('-date')[:5] - return {'recent_posts': recent_posts} +def recent_posts(): + recent_posts = Post.objects.filter(is_public=True).order_by('-date')[1:6] + return recent_posts -def categories(request): +def categories(): categories = Category.objects.all() - return {'categories': categories} + return categories -def archives(request): +def archives(): archives = Post.objects.filter(is_public=True).dates('date', 'month', order='DESC') - return {'archives': archives} + return archives |
