I would like to hide all the \"Save\" buttons in Django\'s Admin\'s Change Form, for a specific model, when certain conditions are met. Therefore, I override the chang
I have an alternative way to hide the "Save and add another" button.
In form.py
class TestForm(forms.ModelForm):
class Media:
js = ('admin/yourjsfile.js',)
In yourjsfile.js
(function($) {
'use strict';
$(document).ready(function() {
// hide the "Save and add another" button
$("input[name='_addanother']").attr('type','hidden');
});
})(django.jQuery);
I had same issue for hiding that button. I've tested it in Django 1.11 and it did work, but I think there are better ways to achieve it.