title: Readonly for existing items only in Django admin inline
body: <p>I have a tabular inline model in the Django admin. I need 1 of the fields to not be changeable after it has been created, but setting it as readonly (via readonly_fields) which works fine, but turns the field into a label when clicking 'Add another item' instead of a dropdown.</p>
  
  <p>Is there a way to keep a field readonly, but still allow new items to be created with the proper field input?</p>
  
  <p>Thanks!</p>
  
  <p>Thomas</p>
  
  <p>Edit: Managed to figure it out by way of a custom widget</p>
  
  <pre><code>class ReadOnlySelectWidget(forms.Select):
      def render(self, name, value, attrs=None):
          if value:
              final_attrs = self.build_attrs(attrs, name=name)
              output = u'&lt;input value="%s" type="hidden" %s /&gt;' % (value, flatatt(final_attrs))
              return mark_safe(output + str(self.choices.queryset.get(id=value)))
          else:
              return super(ReadOnlySelectWidget, self).render(name, value, attrs)
  </code></pre>
  
  <p>It just turns it into a hidden if there is a value, won't work in every situation (only really works with 1 read only field).</p>