Changeset - 1704584f3436
[Not reviewed]
0 1 0
Bradley Kuhn (bkuhn) - 6 years ago 2015-12-18 19:59:03
bkuhn@ebb.org
Allow up to 5 blog posts on the front page.

We have a lot of blog posts at the moment.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
www/conservancy/frontpage.py
Show inline comments
...
 
@@ -5,20 +5,20 @@ from conservancy.apps.supporters.models import Supporter as Supporter
 
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.
 
    """
 

	
 
    supporters_count = len(Supporter.objects.all().filter(display_until_date__gte=datetime.now()))
 
    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]
 
    blog = BlogEntry.objects.all().filter(pub_date__lte=datetime.now())[:5]
 

	
 
    c = {
 
        'press_releases': press_releases,
 
        'supporters_count': supporters_count,
 
        'blog' : blog
 
    }
 
    return render_to_response("frontpage.html", c, context_instance=RequestContext(request))
0 comments (0 inline, 0 general)