From 7b3ec6bcc8309d5b2003d355fe6f78af89cfeb52 Mon Sep 17 00:00:00 2001 From: Matthias Kestenholz Date: Thu, 14 Jan 2021 14:02:23 +0100 Subject: [PATCH] Fixed #32371 -- Doc'd jquery.init.js dependency for admin widgets. --- docs/ref/contrib/admin/index.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt index 0a42199c34a..1fd5d0f60a2 100644 --- a/docs/ref/contrib/admin/index.txt +++ b/docs/ref/contrib/admin/index.txt @@ -2218,7 +2218,10 @@ Django admin JavaScript makes use of the `jQuery`_ library. To avoid conflicts with user-supplied scripts or libraries, Django's jQuery (version 3.5.1) is namespaced as ``django.jQuery``. If you want to use jQuery in your own admin JavaScript without including a second copy, you can use the -``django.jQuery`` object on changelist and add/edit views. +``django.jQuery`` object on changelist and add/edit views. Also, your own admin +forms or widgets depending on ``django.jQuery`` must specify +``js=['admin/js/jquery.init.js', …]`` when :ref:`declaring form media assets +`. The :class:`ModelAdmin` class requires jQuery by default, so there is no need to add jQuery to your ``ModelAdmin``’s list of media resources unless you have