- December 29, 2009
- Not specified
- 0 (after 0 ratings)
The Django Admin site provides a "raw ID" feature for foreign keys that reference large tables. In the form view, the label of the referenced object will appear after the input. This snippet will make that label into a hyperlink that takes you to the form view for that object.
To use this snippet, copy base_site.html into your templates/admin directory (if you haven't already), and paste this code into that file somewhere after the 'extends "admin/base.html"' directive. If you are already using jQuery, you can remove the first script tag. If you are already extending "extrahead", just paste the script tag(s) into the block you have created.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
More like this
- Django Collapsed Stacked Inlines by applecat 3 months, 1 week ago
- Django Collapsed Stacked Inlines by mkarajohn 2 years, 4 months ago
- Dynamically adding forms to a formset. OOP version. by halfnibble 8 years ago
- Convert multiple select for m2m to multiple checkboxes in django admin form by abidibo 10 years, 1 month ago
Please login first before commenting.