[Django]-How to add ajax onto django admin

4πŸ‘

You can add JS code to Admin objects using its Media class. There you can probably define functions to submit changes through Ajax.

πŸ‘€che

0πŸ‘

is it possible to use ajax to save the entire form instead? Just keep a list of changes and save only the intended change

Admin uses formsets to display dtata in multiple forms and formset.save() checks for formset.changed_forms before saving. So, only necessary db writes happen. Not every db entry is re-written.

πŸ‘€lprsd

0πŸ‘

Old question, but I found it when googling. Try https://github.com/sjrd/django-ajax-selects

πŸ‘€Jens Alm

Leave a comment