From c51b32c1687ad55d19e38bfc6c285a19e5738413 Mon Sep 17 00:00:00 2001 From: Graham Ullrich Date: Fri, 12 Feb 2016 12:45:27 -0700 Subject: [PATCH] Updating URL names with "pinax_" prefix fixes #6 --- pinax/documents/models.py | 6 +++--- pinax/documents/urls.py | 16 ++++++++-------- pinax/documents/views.py | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/pinax/documents/models.py b/pinax/documents/models.py index 9607ef9..9217799 100644 --- a/pinax/documents/models.py +++ b/pinax/documents/models.py @@ -49,7 +49,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 @@ -192,7 +192,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 @@ -259,7 +259,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 09b1faf..0a71e5e 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)