* The new module is called methods.py and found on each app. * Add keyword arguments to add_to_class instances. * Remove catch all exception handling for the check in and check out views. * Improve checkouts tests code reducing redundant code. Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
37 lines
989 B
Python
37 lines
989 B
Python
from __future__ import unicode_literals
|
|
|
|
from django.conf.urls import url
|
|
|
|
from .api_views import APICheckedoutDocumentListView, APICheckedoutDocumentView
|
|
from .views import (
|
|
CheckoutDocumentView, CheckoutDetailView, CheckoutListView,
|
|
DocumentCheckinView
|
|
)
|
|
|
|
urlpatterns = [
|
|
url(r'^list/$', CheckoutListView.as_view(), name='check_out_list'),
|
|
url(
|
|
r'^(?P<pk>\d+)/check/out/$', CheckoutDocumentView.as_view(),
|
|
name='check_out_document'
|
|
),
|
|
url(
|
|
r'^(?P<pk>\d+)/check/in/$', DocumentCheckinView.as_view(),
|
|
name='check_in_document'
|
|
),
|
|
url(
|
|
r'^(?P<pk>\d+)/check/info/$', CheckoutDetailView.as_view(),
|
|
name='check_out_info'
|
|
),
|
|
]
|
|
|
|
api_urls = [
|
|
url(
|
|
r'^checkouts/$', APICheckedoutDocumentListView.as_view(),
|
|
name='checkout-document-list'
|
|
),
|
|
url(
|
|
r'^checkouts/(?P<pk>[0-9]+)/checkout_info/$', APICheckedoutDocumentView.as_view(),
|
|
name='checkedout-document-view'
|
|
),
|
|
]
|