diff options
| author | Tom Christie | 2012-02-21 20:47:55 +0000 | 
|---|---|---|
| committer | Tom Christie | 2012-02-21 20:47:55 +0000 | 
| commit | ca9465f11e3310b7b1e18cd893e96b69963f68c9 (patch) | |
| tree | f6e0221b7ed7d5156962099444350d2018bf1aac /docs | |
| parent | b7c06dd8e37fa88ec055831b650967d76e1b78af (diff) | |
| download | django-rest-framework-ca9465f11e3310b7b1e18cd893e96b69963f68c9.tar.bz2 | |
reverse gets it's own module
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/howto/reverse.rst | 18 | ||||
| -rw-r--r-- | docs/library/reverse.rst | 5 | ||||
| -rw-r--r-- | docs/library/utils.rst | 5 | 
3 files changed, 10 insertions, 18 deletions
diff --git a/docs/howto/reverse.rst b/docs/howto/reverse.rst index e4efbbca..73b8fa4d 100644 --- a/docs/howto/reverse.rst +++ b/docs/howto/reverse.rst @@ -1,12 +1,6 @@  Returning URIs from your Web APIs  ================================= -    "The central feature that distinguishes the REST architectural style from -    other network-based styles is its emphasis on a uniform interface between -    components." - -    -- Roy Fielding, Architectural Styles and the Design of Network-based Software Architectures -  As a rule, it's probably better practice to return absolute URIs from you web APIs, e.g. "http://example.com/foobar", rather than returning relative URIs, e.g. "/foobar".  The advantages of doing so are: @@ -23,9 +17,9 @@ There's no requirement for you to use them, but if you do then the self-describi  reverse(viewname, request, ...)  ------------------------------- -The :py:func:`~utils.reverse` function has the same behavior as :py:func:`django.core.urlresolvers.reverse` [1]_, except that it takes a request object and returns a fully qualified URL, using the request to determine the host and port:: +The :py:func:`~reverse.reverse` function has the same behavior as `django.core.urlresolvers.reverse`_, except that it takes a request object and returns a fully qualified URL, using the request to determine the host and port:: -    from djangorestframework.utils import reverse +    from djangorestframework.reverse import reverse      from djangorestframework.views import View      class MyView(View): @@ -39,9 +33,7 @@ The :py:func:`~utils.reverse` function has the same behavior as :py:func:`django  reverse_lazy(viewname, request, ...)  ------------------------------------ -The :py:func:`~utils.reverse_lazy` function has the same behavior as :py:func:`django.core.urlresolvers.reverse_lazy` [2]_, except that it takes a request object and returns a fully qualified URL, using the request to determine the host and port. - -.. rubric:: Footnotes +The :py:func:`~reverse.reverse_lazy` function has the same behavior as `django.core.urlresolvers.reverse_lazy`_, except that it takes a request object and returns a fully qualified URL, using the request to determine the host and port. -.. [1] https://docs.djangoproject.com/en/dev/topics/http/urls/#reverse -.. [2] https://docs.djangoproject.com/en/dev/topics/http/urls/#reverse-lazy +.. _django.core.urlresolvers.reverse: https://docs.djangoproject.com/en/dev/topics/http/urls/#reverse +.. _django.core.urlresolvers.reverse_lazy: https://docs.djangoproject.com/en/dev/topics/http/urls/#reverse-lazy diff --git a/docs/library/reverse.rst b/docs/library/reverse.rst new file mode 100644 index 00000000..a2c29c48 --- /dev/null +++ b/docs/library/reverse.rst @@ -0,0 +1,5 @@ +:mod:`reverse` +================ + +.. automodule:: reverse +   :members: diff --git a/docs/library/utils.rst b/docs/library/utils.rst deleted file mode 100644 index 653f24fd..00000000 --- a/docs/library/utils.rst +++ /dev/null @@ -1,5 +0,0 @@ -:mod:`utils` -============== - -.. automodule:: utils -   :members:  | 
