# Path: django_de/events/views.py
# def events_list(request, year=None, month=None, day=None):
#     """
#     A simple index view that can be restricted to a certain year, year+month or
#     year+month+day.
#     """
#     query = models.Event.objects
#     filter_ = Q()
#     if year is not None:
#         filter_ &= Q(start__year=int(year))
#     if month is not None:
#         filter_ &= Q(start__month=int(month))
#     if day is not None:
#         filter_ &= Q(start__day=int(day))
#     if filter_ is not None:
#         query = query.filter(filter_)
# 
#     query = query.filter(start__gte=date.today()).order_by('start')
#     return render(request, 'events/list.html', {
#         'object_list': query,
#     })


from django.conf.urls import url, patterns
from .views import events_list



urlpatterns = patterns('',
    url(r'^((?P<year>\d{4})/((?P<month>\d{2})/((?P<day>\d{2})/)?)?)?$', events_list,
        name='events_list'),

# Path: django_de/events/views.py
# def events_list(request, year=None, month=None, day=None):
#     """
#     A simple index view that can be restricted to a certain year, year+month or
#     year+month+day.
#     """
#     query = models.Event.objects
#     filter_ = Q()
#     if year is not None:
#         filter_ &= Q(start__year=int(year))
#     if month is not None:
#         filter_ &= Q(start__month=int(month))
#     if day is not None:
#         filter_ &= Q(start__day=int(day))
#     if filter_ is not None:
#         query = query.filter(filter_)
# 
#     query = query.filter(start__gte=date.today()).order_by('start')
#     return render(request, 'events/list.html', {
#         'object_list': query,
#     })


# Path: django_de/events/urls.py
from django.conf.urls import url, patterns
from .views import events_list




urlpatterns = patterns('',
    url(r'^((?P<year>\d{4})/((?P<month>\d{2})/((?P<day>\d{2})/)?)?)?$', events_list,
        name='events_list'),

)