2010-09-26 21:20:05 +00:00
|
|
|
from django.shortcuts import render_to_response
|
2010-09-26 21:56:29 +00:00
|
|
|
from conservancy.apps.news.models import PressRelease
|
2010-09-26 21:20:05 +00:00
|
|
|
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]
|
|
|
|
|
|
|
|
c = {
|
|
|
|
'press_releases': press_releases,
|
|
|
|
}
|
|
|
|
return render_to_response("frontpage.html", c)
|