Permalink
Browse files

newforms-admin: Added some documentation about media defintions in Mo…

…delAdmin classes. Fixed #7129.

git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7873 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 2e72445 commit d9a2441c482a8b35da3e1cecc18b830d90015c6f @brosner brosner committed Jul 9, 2008
Showing with 19 additions and 0 deletions.
  1. +19 −0 docs/admin.txt
View
19 docs/admin.txt
@@ -481,6 +481,25 @@ with an operator:
Performs a full-text match. This is like the default search method but uses
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
============================

0 comments on commit d9a2441

Please sign in to comment.