title: How to add a modeladmin extra form field to readonly_fields?
body: <p>When adding an extra form field to the <code>readonly_fields</code> of a <code>ModelAdmin</code> I get an <code>ImproperlyConfigured</code> error when opening the admin page of an instance of my model:</p>
  
  <pre><code>TaskClosedAdmin.readonly_fields[0], 'extra_admin_field' is not a callable or an attribute of 'TaskClosedAdmin' or found in the model 'TaskClosed'.
  </code></pre>
  
  <p>How can I add the extra field to readonly_fields?</p>
  
  <p><b>EDIT</b></p>
  
  <p>I also tried in the <code>get_form()</code> of <code>TaskClosedAdmin</code>, thinking that the fields might be updated after <code>super(TaskClosedAdmin, self).get_form(request, obj, **kwargs)</code> :</p>
  
  <pre><code>def get_form(self, request, obj=None, **kwargs):
      form = super(TaskClosedAdmin, self).get_form(request, obj, **kwargs)
      self.readonly_fields = obj._meta.get_all_field_names()
      self.readonly_fields.append('extra_admin_field')
      return form
  </code></pre>
  
  <p>and I still get the same error about <code>extra_admin_field</code> not existing... Where can I add it?</p>
  
  <p><b>models.py</b></p>
  
  <pre><code>class Task(models.Model):
  
      # some fields
  
  
  class TaskToConfirm(Task):
      class Meta:
          proxy = True
  </code></pre>
  
  <p><b>admin.py</b></p>
  
  <pre><code>class TaskForm(forms.ModelForm):
  
      extra_admin_field = forms.CharField(max_length=10)
  
      class Meta:
          model = Task
  
  
      def __init__(self, *args, **kwargs):
  
          super(TaskForm, self).__init__(*args, **kwargs)
  
          # set extra_admin_field value
  
  
  class TaskAdmin(admin.ModelAdmin):
  
      form = TaskForm
  
  
  class TaskClosedAdmin(TaskAdmin):
  
       readonly_fields = ('extra_admin_field',)
  </code></pre>