title: How do I right-align read-only fields in Django admin?
body: <p>I want to right align numeric fields in the admin interface of my Django app. For "normal" editable fields this works ok by overriding <code>formfield_for_dbfield(self, db_field, **kwargs):</code> for the <code>ModelAdmin</code> class:</p>
  
  <pre><code>def formfield_for_dbfield(self, db_field, **kwargs):
      field = super(MyModelAdmin, self).formfield_for_dbfield(db_field, **kwargs)
      if db_field.name in ("total_amount", "total_discount_amount"):
          field.widget.attrs['style'] = 'text-align:right;'
      return field
  </code></pre>
  
  <p>When a field is defined as a read-only field, it by passes this method and gets rendered in a different way (apparently just as a css styled paragraph tag).</p>
  
  <p>Is there a way to right align a read-only field? I found <a href="https://stackoverflow.com/questions/8706408/django-admin-how-to-format-readonly-fields">this question</a> on SO but its problem is a different one from mine, I think...</p>