示例#1
0
def index(request):
    context = {}
    context['state'] = status.isOpen()
    context['events'] = get_events()
    context.update(csrf(request))
    # limit to 10 - 15
    diary_items = DiaryItem.objects.filter(start_date__lte=datetime.date.today()).order_by('-start_date', '-start_time')[:15];
    for di in diary_items:
        di.html = markdown(di.content)
        di.datestring = di.start_date.strftime("%d.%m.%Y")
        di.timestring = di.start_time.strftime("%H:%M Uhr")
        image_items = ImageItem.objects.filter(diary_item=di)
        di.images = image_items
    context['items'] = diary_items
    return render_to_response("index.html", context)
示例#2
0
def location(request):
    context = {}
    context['state'] = status.isOpen()
    context['events'] = get_events()
    context.update(csrf(request))
    return render_to_response("location.html", context)