Disable choice list in Django admin, only for editing
问题 I want to disable some fields when I am editing an object. I have managed to do this for text fields, but it's been impossible for a dropdown list (choice list). I am doing this action in the constructor of the form. class OrderModelForm(forms.ModelForm): def __init__(self, *args, **kwargs): super(forms.ModelForm, self).__init__(*args, **kwargs) instance = getattr(self, 'instance', None) if instance and instance.pk: self.fields['description'].widget.attrs['readonly'] = True self.fields['city