diff --git a/pinax/documents/models.py b/pinax/documents/models.py index 688c7d3..6520343 100644 --- a/pinax/documents/models.py +++ b/pinax/documents/models.py @@ -47,7 +47,7 @@ def save(self, **kwargs): super(Folder, self).save(**kwargs) def get_absolute_url(self): - return reverse("documents_folder_detail", args=[self.pk]) + return reverse("pinax_documents_folder_detail", args=[self.pk]) def unique_id(self): return "f-%d" % self.id @@ -190,7 +190,7 @@ def save(self, **kwargs): super(Document, self).save(**kwargs) def get_absolute_url(self): - return reverse("documents_document_detail", args=[self.pk]) + return reverse("pinax_documents_document_detail", args=[self.pk]) def unique_id(self): return "d-%d" % self.id @@ -257,7 +257,7 @@ def share(self, users): model._default_manager.bulk_create(objs) def download_url(self): - return reverse("documents_document_download", args=[self.pk, os.path.basename(self.file.name).lower()]) + return reverse("pinax_documents_document_download", args=[self.pk, os.path.basename(self.file.name).lower()]) class MemberSharedUser(models.Model): diff --git a/pinax/documents/urls.py b/pinax/documents/urls.py index 38dc52e..d853c82 100644 --- a/pinax/documents/urls.py +++ b/pinax/documents/urls.py @@ -4,12 +4,12 @@ urlpatterns = [ - url(r"^$", views.IndexView.as_view(), name="documents_index"), - url(r"^f/create/$", views.folder_create, name="documents_folder_create"), - url(r"^d/create/$", views.document_create, name="documents_document_create"), - url(r"^f/(\d+)/$", views.folder_detail, name="documents_folder_detail"), - url(r"^f/(\d+)/share/$", views.folder_share, name="documents_folder_share"), - url(r"^d/(\d+)/$", views.document_detail, name="documents_document_detail"), - url(r"^d/(\d+)/([^/]+)$", views.document_download, name="documents_document_download"), - url(r"^d/delete/$", views.document_delete, name="documents_document_delete"), + url(r"^$", views.IndexView.as_view(), name="pinax_documents_index"), + url(r"^f/create/$", views.folder_create, name="pinax_documents_folder_create"), + url(r"^d/create/$", views.document_create, name="pinax_documents_document_create"), + url(r"^f/(\d+)/$", views.folder_detail, name="pinax_documents_folder_detail"), + url(r"^f/(\d+)/share/$", views.folder_share, name="pinax_documents_folder_share"), + url(r"^d/(\d+)/$", views.document_detail, name="pinax_documents_document_detail"), + url(r"^d/(\d+)/([^/]+)$", views.document_download, name="pinax_documents_document_download"), + url(r"^d/delete/$", views.document_delete, name="pinax_documents_document_delete"), ] diff --git a/pinax/documents/views.py b/pinax/documents/views.py index 8641f0a..36714c4 100644 --- a/pinax/documents/views.py +++ b/pinax/documents/views.py @@ -165,7 +165,7 @@ def folder_share(request, pk): if "remove" in request.POST: user_to_remove = User.objects.get(pk=request.POST["remove"]) messages.success(request, "{} has been removed from folder share".format(user_display(user_to_remove))) - return redirect("documents_folder_share", folder.pk) + return redirect("pinax_documents_folder_share", folder.pk) else: form = ColleagueFolderShareForm(request.POST, **form_kwargs) if form.is_valid(): @@ -182,6 +182,6 @@ def folder_share(request, pk): def document_delete(request): - redirect_to = default_redirect(request, reverse("documents_index")) + redirect_to = default_redirect(request, reverse("pinax_documents_index")) messages.success(request, "Document has been deleted") return redirect(redirect_to)