Exemple #1
0
def events(request, year, month=None, day=None):
    event_list = event_service.get_event_query_set()
    event_list = event_list.filter(date_time_begin__year=year)
    if month:
        event_list = event_list.filter(date_time_begin__month=month)
    if day:
        event_list = event_list.filter(date_time_begin__day=day)
    events_as_json = json_service.get_events_as_json(event_list)
    return HttpResponse(events_as_json, content_type="application/json")
Exemple #2
0
def tag(request, tag_name):
    try:
        tag = get_object_or_404(EventTag, name=tag_name)
        event_list = event_service.get_event_query_set()
        event_list = event_list.filter(tags=tag)
    except EventTag.DoesNotExist:
        event_list()
    page = __get_paginator_page(request, event_list)
    if page == -1:
        return HttpResponseNotFound()
    tags = event_service.get_current_tags()
    return render_to_response(
        'events/index.html', 
        {
            'event_list': page, 
            'tags': tags, 
            'tag_name': tag_name
        }, 
        context_instance=RequestContext(request))
Exemple #3
0
def index(request):
    event_list = event_service.get_event_query_set()
    tags = event_service.get_current_tags()
    page = __get_paginator_page(request, event_list)
    return __render_index_template(request, event_list, tags)