Files @ 835d482604b3
Branch filter:

Location: website/www/conservancy/frontpage.py

bkuhn
No longer "stash" the GET object in self.

I don't think this was actually necessary ultimately. I think the older
code, herein removed, in item_author_email() was wrong-headed in the
first place, or at the very least, was overkill.

Each item has a distinct author, according to the BlogEntry model. So,
I think this is actually what we want. I noticed the author filed isn't
properly going into the RSS at the moment anyway, but I'm somewhat past
caring about that, as long as the URLs now work to get author- and tag-
specific feeds.
from django.shortcuts import render_to_response
from conservancy.apps.news.models import PressRelease
from conservancy.apps.blog.models import Entry as BlogEntry
from datetime import datetime, timedelta

def view(request):
    """Conservancy front page view

    Performs all object queries necessary to render the front page.
    """

    press_releases = PressRelease.objects.all().filter(pub_date__lte=datetime.now(), sites=2)[:5]
    blog = BlogEntry.objects.all().filter(pub_date__lte=datetime.now())[:3]

    c = {
        'press_releases': press_releases,
        'blog' : blog
    }
    return render_to_response("frontpage.html", c)