コード例 #1
0
 def _get_event_list(self, user, ev_type):
     url = reverse('flexbookings:events')
     request = self.factory.get(url)
     request.user = user
     view = EventListView.as_view()
     return view(request, ev_type=ev_type)
コード例 #2
0
ファイル: urls.py プロジェクト: rebkwok/flexibeast
    #     'flex_bookings.views.update_booking_cancelled',
    #     name='update_booking_cancelled'),
    url(r'^booking/cancel/(?P<pk>\d+)/$', BookingDeleteView.as_view(),
        name='delete_booking'),
    url(r'^events/(?P<event_slug>[\w-]+)/cancellation-period-past/$',
        cancellation_period_past, name='cancellation_period_past'),
    url(r'^booking/(?P<event_slug>[\w-]+)/duplicate/$',
        duplicate_booking, name='duplicate_booking'),
    url(r'^booking/(?P<event_slug>[\w-]+)/full/$', fully_booked,
        name='fully_booked'),
    url(r'^booking/(?P<event_slug>[\w-]+)/new/$', BookingCreateView.as_view(),
        name='book_event'),
    url(
        r'^workshops/(?P<slug>[\w-]+)/$', EventDetailView.as_view(),
        {'ev_type': 'event'}, name='event_detail'
    ),
    url(
        r'^workshops/$', EventListView.as_view(), {'ev_type': 'events'},
        name='events'
    ),
    url(
        r'^classes/(?P<slug>[\w-]+)/$',  EventDetailView.as_view(),
        {'ev_type': 'lesson'}, name='lesson_detail'),
    url(
        r'^classes/$', EventListView.as_view(), {'ev_type': 'lessons'},
        name='lessons'
    ),
    url(r'^booking/(?P<event_slug>[\w-]+)/not-open/$', booking_not_open,
        name='not_open'),
    ]