Fixed a few errors in the documentation. Thanks, Matthew Flanagan, panni@fragstore.net and adamv.
Fixed #6411, #6426, #6524, #6555. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7130 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
e7b2ad8020
commit
3eec925f73
|
@ -1605,8 +1605,7 @@ the cache of all one-to-many relationships ahead of time. Example::
|
||||||
print e.blog # Doesn't hit the database; uses cached version.
|
print e.blog # Doesn't hit the database; uses cached version.
|
||||||
print e.blog # Doesn't hit the database; uses cached version.
|
print e.blog # Doesn't hit the database; uses cached version.
|
||||||
|
|
||||||
``select_related()`` is documented in the "QuerySet methods that return new
|
``select_related()`` is documented in the `QuerySet methods that return new QuerySets`_ section above.
|
||||||
QuerySets" section above.
|
|
||||||
|
|
||||||
Backward
|
Backward
|
||||||
~~~~~~~~
|
~~~~~~~~
|
||||||
|
|
|
@ -88,7 +88,7 @@ something like::
|
||||||
|
|
||||||
for deserialized_object in serializers.deserialize("xml", data):
|
for deserialized_object in serializers.deserialize("xml", data):
|
||||||
if object_should_be_saved(deserialized_object):
|
if object_should_be_saved(deserialized_object):
|
||||||
obj.save()
|
deserialized_object.save()
|
||||||
|
|
||||||
In other words, the usual use is to examine the deserialized objects to make
|
In other words, the usual use is to examine the deserialized objects to make
|
||||||
sure that they are "appropriate" for saving before doing so. Of course, if you trust your data source you could just save the object and move on.
|
sure that they are "appropriate" for saving before doing so. Of course, if you trust your data source you could just save the object and move on.
|
||||||
|
|
|
@ -395,6 +395,8 @@ See the `internationalization docs`_ for more.
|
||||||
django.core.context_processors.media
|
django.core.context_processors.media
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
**New in Django development version**
|
||||||
|
|
||||||
If ``TEMPLATE_CONTEXT_PROCESSORS`` contains this processor, every
|
If ``TEMPLATE_CONTEXT_PROCESSORS`` contains this processor, every
|
||||||
``RequestContext`` will contain a variable ``MEDIA_URL``, providing the
|
``RequestContext`` will contain a variable ``MEDIA_URL``, providing the
|
||||||
value of the `MEDIA_URL setting`_.
|
value of the `MEDIA_URL setting`_.
|
||||||
|
@ -1014,7 +1016,7 @@ This is not a very common situation, but it's useful if you're rendering a
|
||||||
template yourself. For example::
|
template yourself. For example::
|
||||||
|
|
||||||
def render(self, context):
|
def render(self, context):
|
||||||
t = template.load_template('small_fragment.html')
|
t = template.loader.get_template('small_fragment.html')
|
||||||
return t.render(Context({'var': obj}, autoescape=context.autoescape))
|
return t.render(Context({'var': obj}, autoescape=context.autoescape))
|
||||||
|
|
||||||
If we had neglected to pass in the current ``context.autoescape`` value to our
|
If we had neglected to pass in the current ``context.autoescape`` value to our
|
||||||
|
|
Loading…
Reference in New Issue