Replace function views with class based views

This commit is contained in:
Roberto Rosario
2015-04-06 20:24:18 -04:00
parent 1fa8514367
commit d79f36bfcb
6 changed files with 49 additions and 65 deletions

View File

@@ -3,12 +3,13 @@ from __future__ import unicode_literals
from django.conf.urls import patterns, url
from .api_views import APICheckedoutDocumentListView, APICheckedoutDocumentView
from .views import CheckoutListView
urlpatterns = patterns('checkouts.views',
url(r'^list/$', 'checkout_list', (), 'checkout_list'),
url(r'^(?P<document_pk>\d+)/check/out/$', 'checkout_document', (), 'checkout_document'),
url(r'^(?P<document_pk>\d+)/check/in/$', 'checkin_document', (), 'checkin_document'),
url(r'^(?P<document_pk>\d+)/check/info/$', 'checkout_info', (), 'checkout_info'),
url(r'^list/$', CheckoutListView.as_view(), name='checkout_list'),
url(r'^(?P<document_pk>\d+)/check/out/$', 'checkout_document', name='checkout_document'),
url(r'^(?P<document_pk>\d+)/check/in/$', 'checkin_document', name='checkin_document'),
url(r'^(?P<document_pk>\d+)/check/info/$', 'checkout_info', name='checkout_info'),
)
api_urls = patterns('',