I\'m trying to make all fields readonly without listing them explicitly.
Something like:
class CustomAdmin(admin.ModelAdmin): def get_readonly_fi
You could iterate through the model meta fields:
def get_readonly_fields(self, request, obj=None): if obj: self.readonly_fields = [field.name for field in obj.__class__._meta.fields] return self.readonly_fields