diff options
| author | Tim Graham <timograham@gmail.com> | 2015-08-17 10:45:00 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-09-23 19:31:09 -0400 |
| commit | a25d3ce007b90a0516aed54fc1c5a16510a290e4 (patch) | |
| tree | f8d0566d2d46a2e609cf0d782f0c9cf876ee8409 /docs | |
| parent | 3f50dc2be51ee68ce64ac1faadc91193f03fbe3f (diff) | |
Refs #22218 -- Removed conf.urls.patterns() per deprecation timeline.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/internals/deprecation.txt | 2 | ||||
| -rw-r--r-- | docs/ref/urls.txt | 71 | ||||
| -rw-r--r-- | docs/releases/1.4.txt | 2 | ||||
| -rw-r--r-- | docs/topics/i18n/translation.txt | 8 |
4 files changed, 3 insertions, 80 deletions
diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt index 10bced6dea..99e293d9a9 100644 --- a/docs/internals/deprecation.txt +++ b/docs/internals/deprecation.txt @@ -626,7 +626,7 @@ details on these changes. :mod:`django.contrib.gis.utils` will be removed. * ``django.conf.urls.defaults`` will be removed. The functions - :func:`~django.conf.urls.include`, :func:`~django.conf.urls.patterns` and + :func:`~django.conf.urls.include`, ``patterns()`` and :func:`~django.conf.urls.url` plus :data:`~django.conf.urls.handler404`, :data:`~django.conf.urls.handler500`, are now available through :mod:`django.conf.urls` . diff --git a/docs/ref/urls.txt b/docs/ref/urls.txt index 1fb9375b79..2b40c9eaf6 100644 --- a/docs/ref/urls.txt +++ b/docs/ref/urls.txt @@ -4,77 +4,6 @@ .. module:: django.conf.urls -patterns() ----------- - -.. function:: patterns(prefix, pattern_description, ...) - -.. deprecated:: 1.8 - - ``urlpatterns`` should be a plain list of :func:`django.conf.urls.url` - instances instead. - -A function that takes a prefix, and an arbitrary number of URL patterns, and -returns a list of URL patterns in the format Django needs. - -The first argument to ``patterns()`` is a string ``prefix``. Here's the example -URLconf from the :doc:`Django overview </intro/overview>`:: - - from django.conf.urls import patterns, url - - urlpatterns = patterns('', - url(r'^articles/([0-9]{4})/$', 'news.views.year_archive'), - url(r'^articles/([0-9]{4})/([0-9]{2})/$', 'news.views.month_archive'), - url(r'^articles/([0-9]{4})/([0-9]{2})/([0-9]+)/$', 'news.views.article_detail'), - ) - -In this example, each view has a common prefix -- ``'news.views'``. -Instead of typing that out for each entry in ``urlpatterns``, you can use the -first argument to the ``patterns()`` function to specify a prefix to apply to -each view function. - -With this in mind, the above example can be written more concisely as:: - - from django.conf.urls import patterns, url - - urlpatterns = patterns('news.views', - url(r'^articles/([0-9]{4})/$', 'year_archive'), - url(r'^articles/([0-9]{4})/([0-9]{2})/$', 'month_archive'), - url(r'^articles/([0-9]{4})/([0-9]{2})/([0-9]+)/$', 'article_detail'), - ) - -Note that you don't put a trailing dot (``"."``) in the prefix. Django puts -that in automatically. - -The remaining arguments should be tuples in this format:: - - (regular expression, Python callback function [, optional_dictionary [, optional_name]]) - -The ``optional_dictionary`` and ``optional_name`` parameters are described in -:ref:`Passing extra options to view functions <views-extra-options>`. - -.. note:: - Because ``patterns()`` is a function call, it accepts a maximum of 255 - arguments (URL patterns, in this case). This is a limit for all Python - function calls. This is rarely a problem in practice, because you'll - typically structure your URL patterns modularly by using ``include()`` - sections. However, on the off-chance you do hit the 255-argument limit, - realize that ``patterns()`` returns a Python list, so you can split up the - construction of the list. - - :: - - urlpatterns = patterns('', - ... - ) - urlpatterns += patterns('', - ... - ) - - Python lists have unlimited size, so there's no limit to how many URL - patterns you can construct. The only limit is that you can only create 254 - at a time (the 255th argument is the initial prefix argument). - static() -------- diff --git a/docs/releases/1.4.txt b/docs/releases/1.4.txt index 5b63758bbb..cf0f9a64fb 100644 --- a/docs/releases/1.4.txt +++ b/docs/releases/1.4.txt @@ -1233,7 +1233,7 @@ disable this backward-compatibility shim and deprecation warning. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Until Django 1.3, the functions :func:`~django.conf.urls.include`, -:func:`~django.conf.urls.patterns` and :func:`~django.conf.urls.url` plus +``patterns()`` and :func:`~django.conf.urls.url` plus :data:`~django.conf.urls.handler404`, :data:`~django.conf.urls.handler500` were located in a ``django.conf.urls.defaults`` module. diff --git a/docs/topics/i18n/translation.txt b/docs/topics/i18n/translation.txt index 9b46dfe830..d78862c82c 100644 --- a/docs/topics/i18n/translation.txt +++ b/docs/topics/i18n/translation.txt @@ -1332,13 +1332,7 @@ Django provides two mechanisms to internationalize URL patterns: Language prefix in URL patterns ------------------------------- -.. function:: i18n_patterns(prefix, pattern_description, ...) - -.. deprecated:: 1.8 - - The ``prefix`` argument to ``i18n_patterns()`` has been deprecated and will - not be supported in Django 1.10. Simply pass a list of - :func:`django.conf.urls.url` instances instead. +.. function:: i18n_patterns(*pattern_list) This function can be used in your root URLconf and Django will automatically prepend the current active language code to all url patterns defined within |
