def get_queryset(self): if self.index_instance: if self.index_instance.index_template_node.link_documents: return DocumentListView.get_queryset(self) else: self.object_permission = None return self.index_instance.get_children().order_by('value') else: self.object_permission = None return IndexInstanceNode.objects.none()
def dispatch(self, request, *args, **kwargs): self.index_instance_node = get_object_or_404(IndexInstanceNode, pk=self.kwargs['pk']) AccessControlList.objects.check_access( permissions=permission_document_indexing_view, user=request.user, obj=self.index_instance_node.index()) if self.index_instance_node: if self.index_instance_node.index_template_node.link_documents: return DocumentListView.dispatch(self, request, *args, **kwargs) return SingleObjectListView.dispatch(self, request, *args, **kwargs)
def dispatch(self, request, *args, **kwargs): self.index_instance = get_object_or_404(IndexInstanceNode, pk=self.kwargs['pk']) try: Permission.check_permissions(request.user, (permission_document_indexing_view, )) except PermissionDenied: AccessControlList.objects.check_access( permission_document_indexing_view, request.user, self.index_instance.index) if self.index_instance: if self.index_instance.index_template_node.link_documents: return DocumentListView.dispatch(self, request, *args, **kwargs) return SingleObjectListView.dispatch(self, request, *args, **kwargs)
def dispatch(self, request, *args, **kwargs): self.index_instance = get_object_or_404( IndexInstanceNode, pk=self.kwargs['pk'] ) try: Permission.check_permissions( request.user, (permission_document_indexing_view,) ) except PermissionDenied: AccessControlList.objects.check_access( permission_document_indexing_view, request.user, self.index_instance.index ) if self.index_instance: if self.index_instance.index_template_node.link_documents: return DocumentListView.dispatch( self, request, *args, **kwargs ) return SingleObjectListView.dispatch(self, request, *args, **kwargs)
from django.conf.urls.defaults import patterns, include, url from documents.views import DocumentListView, DocumentCreateView, DocumentUpdateView from django.contrib.auth.decorators import user_passes_test urlpatterns = patterns('', url(r'^$', DocumentListView.as_view(), name='document-list-view'), url(r'^add/$',user_passes_test(lambda u:u.is_staff)(DocumentCreateView.as_view())), url(r'^modify/(?P<pk>\d+)/$',user_passes_test(lambda u:u.is_staff)(DocumentUpdateView.as_view())), )
# created by Navaneeth S, [email protected] from django.conf.urls import url from documents.views import DocumentListView, DocumentCreateView, DocumentDeleteView, DocumentUpdateView urlpatterns = [ url(r'^$', DocumentListView.as_view(), name='document'), url(r'^create/$', DocumentCreateView.as_view(), name='document_create'), url(r'^(?P<pk>[0-9]+)/update/$', DocumentUpdateView.as_view(), name='document_update'), url(r'^(?P<pk>[0-9]+)/delete/$', DocumentDeleteView.as_view(), name='document_delete'), ]
from django.conf.urls import url from documents.views import DocumentCounterRedirectView, DocumentListView urlpatterns = [ url(r'^$', DocumentListView.as_view(), name='document_list'), url(r'^(?P<pk>\d+)/$', DocumentCounterRedirectView.as_view(), name='document_counter'), ]
''' from django.urls import path from documents.views import DocumentUpdateView, DocumentDeleteView,\ DocumentListView, DocumentDetailView, model_form_upload,\ DocumentTypeCreateView, DocumentTypeUpdateView, DocumentTypeDeleteView,\ DocumentTypeListView urlpatterns = [ path('uplaod/<int:pk>', model_form_upload, name='document-uplaod'), path('update/<int:pk>', DocumentUpdateView.as_view(), name='document-update'), path('delete/<int:pk>', DocumentDeleteView.as_view(), name='document-delete'), path('list/<int:pk>', DocumentListView.as_view(), name='document-list'), path('details/<int:pk>', DocumentDetailView.as_view(), name='document-detail'), path('documenttype/add/<int:pk>', DocumentTypeCreateView.as_view(), name='documenttype-add'), path('documenttype/<int:pk>/', DocumentTypeUpdateView.as_view(), name='documenttype-update'), path('documenttype/<int:pk>/delete/', DocumentTypeDeleteView.as_view(), name='documenttype-delete'), path('documenttype/list/<int:pk>', DocumentTypeListView.as_view(), name='documenttype-list'),