Permalink
Browse files

Fixed #12469 - Add a few clarifications to the ModelAdmin.get_urls() …

…docs. Thanks benc for the suggestions.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@15113 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 8219a13 commit 7902a89cedfeb37713158b85c109cac830c4e68d @timgraham timgraham committed Dec 29, 2010
Showing with 8 additions and 0 deletions.
  1. +8 −0 docs/ref/contrib/admin/index.txt
@@ -847,13 +847,21 @@ templates used by the :class:`ModelAdmin` views:
)
return my_urls + urls
+ def my_view(self, request):
+ # custom view which should return an HttpResponse
+ pass
+
.. note::
Notice that the custom patterns are included *before* the regular admin
URLs: the admin URL patterns are very permissive and will match nearly
anything, so you'll usually want to prepend your custom URLs to the
built-in ones.
+ In this example, ``my_view`` will be accessed at
+ ``/admin/myapp/mymodel/my_view/`` (assuming the admin URLs are included
+ at ``/admin/``.)
+
However, the ``self.my_view`` function registered above suffers from two
problems:

0 comments on commit 7902a89

Please sign in to comment.