#11977 closed (invalid)
The media files in ModelAdmin should be just link in add/change pages, not changelist page.
Reported by: | anonymous | Owned by: | nobody |
---|---|---|---|
Component: | contrib.admin | Version: | 1.1 |
Severity: | Keywords: | admin media | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
In admin.py file, I write a ModelAdmin class, and add a Media class to link extend css and js file:
class AccountSmsAdmin(admin.ModelAdmin): class Media: css = {"all":("aaa.css",)} js = ("js/jquery-1.3.2.min.js", "js/change_sms.js",)
I find theses css and js file not only link in add/change page(http://127.0.0.1:8000/admin/server/smsaccount/add/, http://127.0.0.1:8000/admin/server/smsaccount/1/), but also in change list page http://127.0.0.1:8000/admin/server/smsaccount/ . it's not correct.
Note:
See TracTickets
for help on using tickets.
If you want to specify media which only appears on the change page, you can use a custom form class.