From db896a620e227628b90014dcd1b7220fc98ce6db Mon Sep 17 00:00:00 2001
From: Derek Willis <dwillis@gmail.com>
Date: Sat, 18 Sep 2010 23:15:36 -0400
Subject: [PATCH] Replaced absolute URL with absolute path reference in docs
---
docs/faq/usage.txt | 4 ++--
docs/intro/tutorial03.txt | 3 ++-
docs/ref/contrib/sitemaps.txt | 14 +++++++-------
docs/ref/contrib/syndication.txt | 6 +++---
docs/ref/models/fields.txt | 2 +-
docs/ref/models/instances.txt | 6 +++---
docs/ref/request-response.txt | 4 ++--
docs/ref/templates/builtins.txt | 7 ++++---
docs/topics/auth.txt | 8 ++++----
9 files changed, 28 insertions(+), 26 deletions(-)
diff --git a/docs/faq/usage.txt b/docs/faq/usage.txt
index 856b97c..5c4cd5f 100644
a
|
b
|
Using a :class:`~django.db.models.FileField` or an
|
63 | 63 | (relative to :setting:`MEDIA_ROOT`). You'll most likely want to use the |
64 | 64 | convenience :attr:`~django.core.files.File.url` attribute provided by |
65 | 65 | Django. For example, if your :class:`~django.db.models.ImageField` is |
66 | | called ``mug_shot``, you can get the absolute URL to your image in a |
67 | | template with ``{{ object.mug_shot.url }}``. |
| 66 | called ``mug_shot``, you can get the absolute path reference to your |
| 67 | image in a template with ``{{ object.mug_shot.url }}``. |
68 | 68 | |
69 | 69 | How do I make a variable available to all my templates? |
70 | 70 | ------------------------------------------------------- |
diff --git a/docs/intro/tutorial03.txt b/docs/intro/tutorial03.txt
index d347035..3599af4 100644
a
|
b
|
decoupling is to make it easy to plug-and-play URLs. Now that polls are in their
|
514 | 514 | own URLconf, they can be placed under "/polls/", or under "/fun_polls/", or |
515 | 515 | under "/content/polls/", or any other URL root, and the app will still work. |
516 | 516 | |
517 | | All the poll app cares about is its relative URLs, not its absolute URLs. |
| 517 | All the poll app cares about is its relative URLs, not its absolute path |
| 518 | references. |
518 | 519 | |
519 | 520 | When you're comfortable with writing views, read :doc:`part 4 of this tutorial |
520 | 521 | </intro/tutorial04>` to learn about simple form processing and generic views. |
diff --git a/docs/ref/contrib/sitemaps.txt b/docs/ref/contrib/sitemaps.txt
index 7a66cbe..46acb3f 100644
a
|
b
|
Sitemap class reference
|
143 | 143 | |
144 | 144 | **Optional.** Either a method or attribute. |
145 | 145 | |
146 | | If it's a method, it should return the absolute URL for a given object as |
147 | | returned by :attr:`~Sitemap.items()`. |
| 146 | If it's a method, it should return the absolute path reference for a |
| 147 | given object as returned by :attr:`~Sitemap.items()`. |
148 | 148 | |
149 | | If it's an attribute, its value should be a string representing an absolute URL |
150 | | to use for *every* object returned by :attr:`~Sitemap.items()`. |
| 149 | If it's an attribute, its value should be a string representing an absolute |
| 150 | path reference to use for *every* object returned by :attr:`~Sitemap.items()`. |
151 | 151 | |
152 | | In both cases, "absolute URL" means a URL that doesn't include the protocol or |
153 | | domain. Examples: |
| 152 | In both cases, "absolute path reference" means a URL that doesn't |
| 153 | include the protocol or domain. Examples: |
154 | 154 | |
155 | 155 | * Good: :file:`'/foo/bar/'` |
156 | 156 | * Bad: :file:`'example.com/foo/bar/'` |
… |
… |
that: :func:`django.contrib.sitemaps.ping_google()`.
|
300 | 300 | .. function:: ping_google |
301 | 301 | |
302 | 302 | :func:`ping_google` takes an optional argument, :data:`sitemap_url`, |
303 | | which should be the absolute URL of your site's sitemap (e.g., |
| 303 | which should be the absolute path reference of your site's sitemap (e.g., |
304 | 304 | :file:`'/sitemap.xml'`). If this argument isn't provided, |
305 | 305 | :func:`ping_google` will attempt to figure out your |
306 | 306 | sitemap by performing a reverse looking in your URLconf. |
diff --git a/docs/ref/contrib/syndication.txt b/docs/ref/contrib/syndication.txt
index a12d646..acd8ef2 100644
a
|
b
|
comes directly from your :setting:`LANGUAGE_CODE` setting.
|
274 | 274 | URLs |
275 | 275 | ---- |
276 | 276 | |
277 | | The :attr:`link` method/attribute can return either an absolute URL (e.g. |
278 | | :file:`"/blog/"`) or a URL with the fully-qualified domain and protocol (e.g. |
279 | | ``"http://www.example.com/blog/"``). If :attr:`link` doesn't return the domain, |
| 277 | The :attr:`link` method/attribute can return either an absolute path reference |
| 278 | (e.g. :file:`"/blog/"`) or a URL with the fully-qualified domain and protocol |
| 279 | (e.g. ``"http://www.example.com/blog/"``). If :attr:`link` doesn't return the domain, |
280 | 280 | the syndication framework will insert the domain of the current site, according |
281 | 281 | to your :setting:`SITE_ID setting <SITE_ID>`. |
282 | 282 | |
diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt
index 68208b3..4a5c98c 100644
a
|
b
|
takes a few steps:
|
537 | 537 | (relative to :setting:`MEDIA_ROOT`). You'll most likely want to use the |
538 | 538 | convenience :attr:`~django.core.files.File.url` function provided by |
539 | 539 | Django. For example, if your :class:`ImageField` is called ``mug_shot``, |
540 | | you can get the absolute URL to your image in a template with |
| 540 | you can get the absolute path reference to your image in a template with |
541 | 541 | ``{{ object.mug_shot.url }}``. |
542 | 542 | |
543 | 543 | For example, say your :setting:`MEDIA_ROOT` is set to ``'/home/media'``, and |
diff --git a/docs/ref/models/instances.txt b/docs/ref/models/instances.txt
index dfe4c74..251d89b 100644
a
|
b
|
Similarly, if you had a URLconf entry that looked like::
|
491 | 491 | Notice that we specify an empty sequence for the second parameter in this case, |
492 | 492 | because we only want to pass keyword parameters, not positional ones. |
493 | 493 | |
494 | | In this way, you're tying the model's absolute URL to the view that is used |
495 | | to display it, without repeating the URL information anywhere. You can still |
496 | | use the ``get_absolute_url`` method in templates, as before. |
| 494 | In this way, you're tying the model's absolute path reference to the view |
| 495 | that is used to display it, without repeating the URL information anywhere. |
| 496 | You can still use the ``get_absolute_url`` method in templates, as before. |
497 | 497 | |
498 | 498 | In some cases, such as the use of generic views or the re-use of |
499 | 499 | custom views for multiple models, specifying the view function may |
diff --git a/docs/ref/request-response.txt b/docs/ref/request-response.txt
index b8b0882..2eb3075 100644
a
|
b
|
types of HTTP responses. Like ``HttpResponse``, these subclasses live in
|
579 | 579 | |
580 | 580 | The constructor takes a single argument -- the path to redirect to. This |
581 | 581 | can be a fully qualified URL (e.g. ``'http://www.yahoo.com/search/'``) or an |
582 | | absolute URL with no domain (e.g. ``'/search/'``). Note that this returns |
583 | | an HTTP status code 302. |
| 582 | absolute path reference with no domain (e.g. ``'/search/'``). Note that |
| 583 | this returns an HTTP status code 302. |
584 | 584 | |
585 | 585 | .. class:: HttpResponsePermanentRedirect |
586 | 586 | |
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt
index 85c0b6d..876480d 100644
a
|
b
|
The argument tells which template bit to output:
|
915 | 915 | url |
916 | 916 | ~~~ |
917 | 917 | |
918 | | Returns an absolute URL (i.e., a URL without the domain name) matching a given |
919 | | view function and optional parameters. This is a way to output links without |
920 | | violating the DRY principle by having to hard-code URLs in your templates:: |
| 918 | Returns an absolute path reference (a URL without the domain name) |
| 919 | matching a given view function and optional parameters. This is a way to |
| 920 | output links without violating the DRY principle by having to hard-code |
| 921 | URLs in your templates:: |
921 | 922 | |
922 | 923 | {% url path.to.some_view v1 v2 %} |
923 | 924 | |
diff --git a/docs/topics/auth.txt b/docs/topics/auth.txt
index 8c9b0f1..955bde6 100644
a
|
b
|
The login_required decorator
|
728 | 728 | |
729 | 729 | * If the user isn't logged in, redirect to |
730 | 730 | :setting:`settings.LOGIN_URL <LOGIN_URL>` (``/accounts/login/`` by |
731 | | default), passing the current absolute URL in the query string. The |
732 | | name of the GET argument is determined by the ``redirect_field_name`` |
733 | | argument provided to the decorator. The default argument name is |
734 | | ``next``. For example: |
| 731 | default), passing the current absolute path reference in the query |
| 732 | string. The name of the GET argument is determined by the |
| 733 | ``redirect_field_name`` argument provided to the decorator. The |
| 734 | default argument name is ``next``. For example: |
735 | 735 | ``/accounts/login/?next=/polls/3/``. |
736 | 736 | |
737 | 737 | * If the user is logged in, execute the view normally. The view code is |