1
0
mirror of https://github.com/django/django.git synced 2025-07-03 17:29:12 +00:00

newforms-admin: Added some documentation about media defintions in ModelAdmin classes. Fixed #7129.

git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7873 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Brian Rosner 2008-07-09 18:09:38 +00:00
parent 2e72445fce
commit d9a2441c48

View File

@ -481,6 +481,25 @@ with an operator:
Performs a full-text match. This is like the default search method but uses Performs a full-text match. This is like the default search method but uses
an index. Currently this is only available for MySQL. an index. Currently this is only available for MySQL.
``ModelAdmin`` media 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
on your ``ModelAdmin``::
class ArticleAdmin(admin.ModelAdmin):
class Media:
css = {
"all": ("my_styles.css",)
}
js = ("my_code.js",)
Keep in mind that this will be prepended with ``MEDIA_URL``. The same rules
apply as `regular media definitions on forms`_.
.. _regular media definitions on forms: ../newforms/#media
``InlineModelAdmin`` objects ``InlineModelAdmin`` objects
============================ ============================