Opened 15 years ago

Closed 15 years ago

Last modified 13 years ago

#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.

Change History (2)

comment:1 by Matt McClanahan, 15 years ago

Resolution: invalid
Status: newclosed

If you want to specify media which only appears on the change page, you can use a custom form class.

comment:2 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

Note: See TracTickets for help on using tickets.
Back to Top