Skip to content

Commit

Permalink
Updating URL names with "pinax_" prefix
Browse files Browse the repository at this point in the history
fixes #6
  • Loading branch information
grahamu committed Feb 12, 2016
1 parent c7e2a3f commit c51b32c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions pinax/documents/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down
16 changes: 8 additions & 8 deletions pinax/documents/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
]
4 changes: 2 additions & 2 deletions pinax/documents/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand All @@ -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)

0 comments on commit c51b32c

Please sign in to comment.