diff --git a/apps/blog/views.py b/apps/blog/views.py
--- a/apps/blog/views.py
+++ b/apps/blog/views.py
@@ -26,6 +26,8 @@
from tagging.views import tagged_object_list
from render import render
+from django.db.models import Q
+
def _get_reply_to(request):
try:
return int(request.GET.get('reply_to', None))
@@ -35,7 +37,18 @@
def post_list(request, *args, **kwargs):
"""Post listing. Only shows posts that are older than now()"""
- kwargs['queryset'] = Post.objects.exclude(date__gt=dt.now())
+
+
+ if request.user.id:
+ # the OR clause includes logged-in user's drafts as well
+ q_lookup = (Q(is_draft=False) | Q(author=request.user))
+ qs = Post.whole_objects.filter(q_lookup)
+ else:
+ qs = Post.objects.all()
+
+ # hide all posts that are not yet published
+ kwargs['queryset'] = qs.exclude(date__gt=dt.now())
+
return object_list(request, *args, **kwargs)
Thanks, applied and pushed. Still not marked as draft in templates, though. ;-)
--
Alexander
Like I said, I wouldn't know how to appropriately screw with other people's
templates, IMO it's best people look at their own templates and if they
find it important enough, they'll submit a patch ;)
--
mjt