Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
url(r'^(?P\d{4})/(?P\w{3})/$', view=EventMonthView.as_view(), name='ev-events-month'),
url(r'^(?P\d{4})/$', view=EventYearView.as_view(), name='ev-events-year'),
url(r'^calendars/(?P[-\w]+)/(?P\d{4})/$', view=EventYearView.as_view(), name='ev-calendar-year'),
url(r'^calendars/(?P[-\w]+)/(?P\d{4})/(?P\w{3})/$', view=EventMonthView.as_view(), name='ev-calendar-month'),
url(r'^calendars/(?P[-\w]+)/$', view=EventListView.as_view(), name='ev-calendar-detail'),
url(r'^calendars/$', view=ListView.as_view(model=Calendar), name='ev-calendar-list'),
url(r'^places/$', view=ListView.as_view(model=Place), name='place-list'),
url(r'^places/(?P[-\w]+)/$', view=DetailView.as_view(model=Place), name='place-detail'),
url(r'^(?P[-\w]+)/(?P\d{4})/(?P\w{3})/(?P\d{1,2})/$', view=EventDetailView.as_view(), name='ev-event-detail'),
url(r'^(?P[-\w]+)/(?P\d{4})/(?P\w{3})/$', view=EventMonthView.as_view(), name='ev-event-month'),
url(r'^(?P[-\w]+)/(?P\d{4})/$', view=EventYearView.as_view(), name='ev-event-year'),
url(r'^(?P[-\w]+)/$', view=DetailView.as_view(model=Event), name='ev-events-info'),
url(r'^$', view=EventListView.as_view(), name='event-list'),
)
def get_context_data(self, **kwargs):
context = super(EventListView, self).get_context_data(**kwargs)
context['month'] = EventCalendar(self.get_queryset()).formatmonth(datetime.now().year, datetime.now().month)
if self.calendar:
context['calendar'] = self.calendar
return context