Update document_reset_view to CBV.
This commit is contained in:
@@ -16,13 +16,14 @@ from .settings import setting_print_size, setting_display_size
|
||||
from .views import (
|
||||
DeletedDocumentDeleteView, DeletedDocumentDeleteManyView,
|
||||
DeletedDocumentListView, DocumentEditView, DocumentListView,
|
||||
DocumentPageView, DocumentPageListView, DocumentPreviewView,
|
||||
DocumentRestoreView, DocumentRestoreManyView, DocumentTrashView,
|
||||
DocumentTrashManyView, DocumentTypeCreateView, DocumentTypeDeleteView,
|
||||
DocumentTypeDocumentListView, DocumentTypeFilenameDeleteView,
|
||||
DocumentTypeFilenameEditView, DocumentTypeFilenameListView,
|
||||
DocumentTypeListView, DocumentTypeEditView, DocumentVersionListView,
|
||||
DocumentView, EmptyTrashCanView, RecentDocumentListView
|
||||
DocumentPageView, DocumentPageListView, DocumentPageViewResetView,
|
||||
DocumentPreviewView, DocumentRestoreView, DocumentRestoreManyView,
|
||||
DocumentTrashView, DocumentTrashManyView, DocumentTypeCreateView,
|
||||
DocumentTypeDeleteView, DocumentTypeDocumentListView,
|
||||
DocumentTypeFilenameDeleteView, DocumentTypeFilenameEditView,
|
||||
DocumentTypeFilenameListView, DocumentTypeListView, DocumentTypeEditView,
|
||||
DocumentVersionListView, DocumentView, EmptyTrashCanView,
|
||||
RecentDocumentListView
|
||||
)
|
||||
|
||||
urlpatterns = patterns(
|
||||
@@ -190,8 +191,8 @@ urlpatterns = patterns(
|
||||
'document_page_rotate_left', name='document_page_rotate_left'
|
||||
),
|
||||
url(
|
||||
r'^page/(?P<document_page_id>\d+)/reset/$',
|
||||
'document_page_view_reset', name='document_page_view_reset'
|
||||
r'^page/(?P<pk>\d+)/reset/$', DocumentPageViewResetView.as_view(),
|
||||
name='document_page_view_reset'
|
||||
),
|
||||
|
||||
# Admin views
|
||||
|
||||
@@ -13,6 +13,7 @@ from django.shortcuts import render_to_response, get_object_or_404
|
||||
from django.template import RequestContext
|
||||
from django.utils.http import urlencode
|
||||
from django.utils.translation import ugettext_lazy as _, ungettext
|
||||
from django.views.generic import RedirectView
|
||||
|
||||
from acls.models import AccessControlList
|
||||
from common.compressed_files import CompressedFile
|
||||
@@ -288,6 +289,10 @@ class DocumentPageView(SimpleView):
|
||||
return get_object_or_404(DocumentPage, pk=self.kwargs['pk'])
|
||||
|
||||
|
||||
class DocumentPageViewResetView(RedirectView):
|
||||
pattern_name = 'documents:document_page_view'
|
||||
|
||||
|
||||
class DocumentPreviewView(SingleObjectDetailView):
|
||||
form_class = DocumentPreviewForm
|
||||
model = Document
|
||||
@@ -971,10 +976,6 @@ def document_multiple_clear_transformations(request):
|
||||
)
|
||||
|
||||
|
||||
def document_page_view_reset(request, document_page_id):
|
||||
return HttpResponseRedirect(reverse('documents:document_page_view', args=(document_page_id,)))
|
||||
|
||||
|
||||
def document_page_navigation_next(request, document_page_id):
|
||||
document_page = get_object_or_404(DocumentPage, pk=document_page_id)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user