lemoncurry/home/views.py

20 lines
516 B
Python
Raw Normal View History

from annoying.decorators import render_to
from django.shortcuts import get_object_or_404
2017-10-22 18:37:24 -04:00
from users.models import User
from lemoncurry import breadcrumbs, utils
breadcrumbs.add('home:index', 'home')
2017-10-22 18:37:24 -04:00
@render_to('home/index.html')
2017-10-22 18:37:24 -04:00
def index(request):
query = User.objects.prefetch_related('entries', 'profiles', 'keys')
user = get_object_or_404(query, pk=1)
uri = utils.uri(request)
return {
'user': user,
'entries': user.entries.all(),
'meta': user.as_meta(request),
}