Skip to content

Commit

Permalink
Added details on minified jQuery and DEBUG mode for contrib.admin.
Browse files Browse the repository at this point in the history
Thanks Daniele Procida.
  • Loading branch information
timgraham committed Jan 13, 2013
1 parent 0ca2d1e commit 4720117
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/ref/contrib/admin/index.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1380,6 +1380,9 @@ The :doc:`staticfiles app </ref/contrib/staticfiles>` prepends
``None``) to any media paths. The same rules apply as :ref:`regular media
definitions on forms <form-media-paths>`.

jQuery
~~~~~~

Django admin Javascript makes use of the `jQuery`_ library. To avoid
conflicts with user-supplied scripts or libraries, Django's jQuery is
namespaced as ``django.jQuery``. If you want to use jQuery in your own admin
Expand All @@ -1390,6 +1393,15 @@ If you require the jQuery library to be in the global namespace, for example
when using third-party jQuery plugins, or need a newer version of jQuery, you
will have to include your own copy of jQuery.

Django provides both uncompressed and 'minified' versions of jQuery, as
``jquery.js`` and ``jquery.min.js`` respectively.

:class:`ModelAdmin` and :class:`InlineModelAdmin` have a ``media`` property
that returns a list of ``Media`` objects which store paths to the JavaScript
files for the forms and/or formsets. If :setting:`DEBUG` is ``True`` it will
return the uncompressed versions of the various JavaScript files, including
``jquery.js``; if not, it will return the 'minified' versions.

.. _jQuery: http://jquery.com

Adding custom validation to the admin
Expand Down

0 comments on commit 4720117

Please sign in to comment.