Skip to content
This repository has been archived by the owner on May 28, 2019. It is now read-only.

Commit

Permalink
Disable caching and add basic "homepage"
Browse files Browse the repository at this point in the history
  • Loading branch information
tofumatt committed Apr 24, 2011
1 parent 77324d3 commit b48cb8f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions apps/chats/views.py
Expand Up @@ -9,12 +9,18 @@
from chats.models import *


@cache_page(60 * 1)
def index(request):
"""Display the site's root/home page."""

chats = Chat.objects.all().order_by('-created_at')

if request.user.is_authenticated():
chats = chats.filter(friend_groups__in=request.user.get_profile().friend_groups.all().values_list('id'))
else:
chats = chats.filter(friend_groups__isnull=True)

return render_to_response('index.html', {

'chats': chats[:10],
}, context_instance=RequestContext(request))

def show(request, id):
Expand Down

0 comments on commit b48cb8f

Please sign in to comment.