[Answered ]-Django Admin: Dynamic Auto-Fill a Form Field from Selected Foreign Key's Attributes

2👍

Yes, if you want the selection to be updated dynamically you’d have to use JS. Doing this kind of stuff would involve hacking the django admin site. You may be able to get away with just customizing the template to load some JS with and event handler that updates the specific drop-down. However this would be vulnerable to breakage when updating Django (the admin site templates have no guarantee of backwards compatibility). Personally I’d just write a custom view.

Leave a comment