Пример #1
0
 def _get_response(self, user):
     url = reverse('flexbookings:booking_history')
     request = self.factory.get(url)
     request.user = user
     view = BookingHistoryListView.as_view()
     return view(request)
Пример #2
0
from django.conf.urls import url
from flex_bookings.views import EventListView, EventDetailView, \
    BookingListView, BookingHistoryListView, BookingCreateView, \
    BookingDeleteView, payments_pending, update_block, update_booking, \
    cancellation_period_past, duplicate_booking, fully_booked, booking_not_open


urlpatterns = [
    url(r'^bookings/$', BookingListView.as_view(), name='bookings'),
    url(
        r'^bookings/payments-pending/$', payments_pending,
        name='payments_pending'
    ),
    url(r'^booking-history/$', BookingHistoryListView.as_view(),
        name='booking_history'),
    url(r'^block/(?P<pk>\d+)/update/$', update_block, name='update_block'),
    url(
       r'^booking/(?P<pk>\d+)/update/$', update_booking, name='update_booking'
    ),
    # url(r'^booking/update/(?P<pk>\d+)/cancelled/$',
    #     '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(),