From 272ceb9584a68c7df464e8633c02eb4f997da092 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Tue, 28 Nov 2023 16:57:48 +0000 Subject: Refs #25778 -- Updated some links and references to HTTPS. --- docs/topics/forms/media.txt | 84 ++++++++++++++++++++++----------------------- 1 file changed, 42 insertions(+), 42 deletions(-) (limited to 'docs/topics/forms') diff --git a/docs/topics/forms/media.txt b/docs/topics/forms/media.txt index 5fdd37437e..6e7bfdcbd4 100644 --- a/docs/topics/forms/media.txt +++ b/docs/topics/forms/media.txt @@ -74,9 +74,9 @@ can be retrieved through this property: >>> w = CalendarWidget() >>> print(w.media) - - - + + + Here's a list of all possible ``Media`` options. There are no required options. @@ -119,9 +119,9 @@ If this last CSS definition were to be rendered, it would become the following H .. code-block:: html+django - - - + + + ``js`` ------ @@ -153,11 +153,11 @@ example above: >>> w = FancyCalendarWidget() >>> print(w.media) - - - - - + + + + + The FancyCalendar widget inherits all the assets from its parent widget. If you don't want ``Media`` to be inherited in this way, add @@ -176,8 +176,8 @@ an ``extend=False`` declaration to the ``Media`` declaration: >>> w = FancyCalendarWidget() >>> print(w.media) - - + + If you require even more control over inheritance, define your assets using a :ref:`dynamic property `. Dynamic properties give you @@ -230,7 +230,7 @@ render a complete web page. To find the appropriate prefix to use, Django will check if the :setting:`STATIC_URL` setting is not ``None`` and automatically fall back to using :setting:`MEDIA_URL`. For example, if the :setting:`MEDIA_URL` for -your site was ``'http://uploads.example.com/'`` and :setting:`STATIC_URL` +your site was ``'https://uploads.example.com/'`` and :setting:`STATIC_URL` was ``None``: .. code-block:: pycon @@ -241,24 +241,24 @@ was ``None``: ... css = { ... "all": ["/css/pretty.css"], ... } - ... js = ["animations.js", "http://othersite.com/actions.js"] + ... js = ["animations.js", "https://othersite.com/actions.js"] ... >>> w = CalendarWidget() >>> print(w.media) - - + + -But if :setting:`STATIC_URL` is ``'http://static.example.com/'``: +But if :setting:`STATIC_URL` is ``'https://static.example.com/'``: .. code-block:: pycon >>> w = CalendarWidget() >>> print(w.media) - - + + Or if :mod:`~django.contrib.staticfiles` is configured using the :class:`~django.contrib.staticfiles.storage.ManifestStaticFilesStorage`: @@ -269,7 +269,7 @@ Or if :mod:`~django.contrib.staticfiles` is configured using the >>> print(w.media) - + Paths as objects ---------------- @@ -316,12 +316,12 @@ operator to filter out a medium of interest. For example: >>> w = CalendarWidget() >>> print(w.media) - - - + + + >>> print(w.media["css"]) - + When you use the subscript operator, the value that is returned is a new ``Media`` object -- but one that only contains the media of interest. @@ -352,10 +352,10 @@ specified by both: >>> w1 = CalendarWidget() >>> w2 = OtherWidget() >>> print(w1.media + w2.media) - - - - + + + + .. _form-media-asset-order: @@ -383,10 +383,10 @@ For example: >>> w1 = CalendarWidget() >>> w2 = TimeWidget() >>> print(w1.media + w2.media) - - - - + + + + Combining ``Media`` objects with assets in a conflicting order results in a ``MediaOrderConflictWarning``. @@ -415,10 +415,10 @@ are part of the form: >>> f = ContactForm() >>> f.media - - - - + + + + If you want to associate additional assets with a form -- for example, CSS for form layout -- add a ``Media`` declaration to the form: @@ -436,8 +436,8 @@ CSS for form layout -- add a ``Media`` declaration to the form: >>> f = ContactForm() >>> f.media - - - - - + + + + + -- cgit v1.3