mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Fixed #19695 -- Retitle "Form Media" to "Form Assets".
This commit is contained in:
parent
660c30ed95
commit
c0f03175ce
7 changed files with 105 additions and 98 deletions
|
@ -1554,13 +1554,13 @@ instances which allow you to easily customize the response data before
|
|||
rendering. For more details, see the :doc:`TemplateResponse documentation
|
||||
</ref/template-response>`.
|
||||
|
||||
.. _modeladmin-media-definitions:
|
||||
.. _modeladmin-asset-definitions:
|
||||
|
||||
``ModelAdmin`` media definitions
|
||||
``ModelAdmin`` asset definitions
|
||||
--------------------------------
|
||||
|
||||
There are times where you would like add a bit of CSS and/or JavaScript to
|
||||
the add/change views. This can be accomplished by using a Media inner class
|
||||
the add/change views. This can be accomplished by using a ``Media`` inner class
|
||||
on your ``ModelAdmin``::
|
||||
|
||||
class ArticleAdmin(admin.ModelAdmin):
|
||||
|
@ -1572,8 +1572,8 @@ on your ``ModelAdmin``::
|
|||
|
||||
The :doc:`staticfiles app </ref/contrib/staticfiles>` prepends
|
||||
:setting:`STATIC_URL` (or :setting:`MEDIA_URL` if :setting:`STATIC_URL` is
|
||||
``None``) to any media paths. The same rules apply as :ref:`regular media
|
||||
definitions on forms <form-media-paths>`.
|
||||
``None``) to any asset paths. The same rules apply as :ref:`regular asset
|
||||
definitions on forms <form-asset-paths>`.
|
||||
|
||||
jQuery
|
||||
~~~~~~
|
||||
|
|
|
@ -171,16 +171,15 @@ You can also set the HTML ``id`` using :attr:`~Widget.attrs`. See
|
|||
Styling widget classes
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
With widgets, it is possible to add media (``css`` and ``javascript``)
|
||||
With widgets, it is possible to add assets (``css`` and ``javascript``)
|
||||
and more deeply customize their appearance and behavior.
|
||||
|
||||
In a nutshell, you will need to subclass the widget and either
|
||||
:ref:`define a class "Media" <media-as-a-static-definition>` as a member of the
|
||||
subclass, or :ref:`create a property "media" <dynamic-property>`, returning an
|
||||
instance of that class.
|
||||
:ref:`define a "Media" inner class <assets-as-a-static-definition>` or
|
||||
:ref:`create a "media" property <dynamic-property>`.
|
||||
|
||||
These methods involve somewhat advanced Python programming and are described in
|
||||
detail in the :doc:`Form Media </topics/forms/media>` topic guide.
|
||||
detail in the :doc:`Form Assets </topics/forms/media>` topic guide.
|
||||
|
||||
.. _base-widget-classes:
|
||||
|
||||
|
|
|
@ -2475,7 +2475,7 @@ URL to use when referring to static files located in :setting:`STATIC_ROOT`.
|
|||
Example: ``"/static/"`` or ``"http://static.example.com/"``
|
||||
|
||||
If not ``None``, this will be used as the base path for
|
||||
:ref:`media definitions<form-media-paths>` and the
|
||||
:ref:`asset definitions<form-asset-paths>` (the ``Media`` class) and the
|
||||
:doc:`staticfiles app</ref/contrib/staticfiles>`.
|
||||
|
||||
It must end in a slash if set to a non-empty value.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue