In models:
class Getdata(models.Model):
title = models.CharField(max_length=255)
state = models.CharField(max_length=2, choices=STATE, default=\"0\")
I think injecting a Jquery/JS code to hide the save button would be a good idea.
Create a custom_validate.js file like below and place it in directory static(static file directory)
if (!$) {
$ = django.jQuery;
}
$( document ).ready(function() {
$("[name=_save]").click(function() {
$("[name=_save]").css("visibility", "hidden");
});
});
And in admin.py, add the below code.
class CustomDataForm(forms.ModelForm):
class Meta:
model = GetData
class GetDataAdmin(admin.ModelAdmin):
# ....
.....
form = CustomDataForm
class Media:
js = ('/static/custom_validate.js', )