~ubuntu-branches/debian/sid/python-django/sid

« back to all changes in this revision

Viewing changes to docs/topics/forms/media.txt

  • Committer: Package Import Robot
  • Author(s): Raphaël Hertzog
  • Date: 2012-10-22 10:53:30 UTC
  • mfrom: (1.2.14)
  • Revision ID: package-import@ubuntu.com-20121022105330-el5jslfv9tkcrwkv
Tags: 1.4.2-1
* New upstream security and maintenance release. Closes: #691145
  Fixes: CVE-2012-4520
* Drop 01_use_stdlib_htmlparser_when_possible.diff which has been
  merged upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
    whichever toolkit suits your requirements. Django is able to integrate
39
39
    with any JavaScript toolkit.
40
40
 
 
41
.. _media-as-a-static-definition:
 
42
 
41
43
Media as a static definition
42
44
----------------------------
43
45
 
78
80
media.
79
81
 
80
82
The values in the dictionary should be a tuple/list of file names. See
81
 
`the section on media paths`_ for details of how to specify paths to media
82
 
files.
83
 
 
84
 
.. _the section on media paths: `Paths in media definitions`_
 
83
:ref:`the section on media paths <form-media-paths>` for details of how to
 
84
specify paths to media files.
85
85
 
86
86
The keys in the dictionary are the output media types. These are the same
87
87
types accepted by CSS files in media declarations: 'all', 'aural', 'braille',
117
117
``js``
118
118
~~~~~~
119
119
 
120
 
A tuple describing the required JavaScript files. See
121
 
`the section on media paths`_ for details of how to specify paths to media
 
120
A tuple describing the required JavaScript files. See :ref:`the section on
 
121
media paths <form-media-paths>` for details of how to specify paths to media
122
122
files.
123
123
 
124
124
``extend``
164
164
    <script type="text/javascript" src="http://media.example.com/whizbang.js"></script>
165
165
 
166
166
If you require even more control over media inheritance, define your media
167
 
using a `dynamic property`_. Dynamic properties give you complete control over
168
 
which media files are inherited, and which are not.
 
167
using a :ref:`dynamic property <dynamic-property>`. Dynamic properties give
 
168
you complete control over which media files are inherited, and which are not.
169
169
 
170
 
.. _dynamic property: `Media as a dynamic property`_
 
170
.. _dynamic-property:
171
171
 
172
172
Media as a dynamic property
173
173
---------------------------
198
198
.. versionchanged:: 1.3
199
199
 
200
200
Paths used to specify media can be either relative or absolute. If a path
201
 
starts with '/', 'http://' or 'https://', it will be interpreted as an absolute
202
 
path, and left as-is. All other paths will be prepended with the value of
203
 
the appropriate prefix.
 
201
starts with ``/``, ``http://`` or ``https://``, it will be interpreted as an
 
202
absolute path, and left as-is. All other paths will be prepended with the value
 
203
of the appropriate prefix.
204
204
 
205
205
As part of the introduction of the
206
206
:doc:`staticfiles app </ref/contrib/staticfiles>` two new settings were added