Opened 12 years ago
Closed 12 years ago
#19065 closed Cleanup/optimization (needsinfo)
The FilteredManyToMany widget needs javascript in 'stacked.html' and 'tabular.html' when using inline content
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | contrib.admin | Version: | 1.4 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I'm developing a custom sortable manytomany widget which allows the user to order the items in the widget.
You can find it here: https://github.com/fabrique/django-sortedm2m
When using inline models the widget needs the javascript in stacked.html and/or tabular.html. It initializes a new instance when adding an inline item.
To keep the sortedm2m library as pluggable as possible I would like to know how I can provide this javascript in the library. This way a developer doesn't need to override the admin templates.
This doesn't seem possible at the moment. Maybe there should be a way to provide document ready javascript in the scope of the widget.
Any ideas on this?
Change History (2)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
Resolution: | → needsinfo |
---|---|
Status: | new → closed |
This is a feature request, and it isn't very precise. In such cases, it's best to write to the django-developers mailing list, and open a ticket once a concrete action plan has been determined.
Overriding admin templates is the canonical way to inject additional features in the admin pages. Your library can ship templates replacing the admin's built-in templates; they will be used if you app comes before django.contrib.admin
in INSTALLED_APPS.
Code used in overridden stacked.html template: