readonly_fields in StackedInline forms in the admin are missing the field label.
|Reported by:||benc||Owned by:||gwilson|
|Severity:||Keywords:||admin, forms, inline, label|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
readonly_field in StackedInline forms in the admin are missing the field label.
The field value is shown but the label is missing.
The label of readonly_field in normal forms is ok.
I'm using the example from the docs about inline forms in the admin: http://docs.djangoproject.com/en/dev/ref/contrib/admin/#inlinemodeladmin-objects
- in the admin create an Author when readonly_fields is commented out so you can create a book and a title.
- remove the comment from readonly_fields from BookInline and see that the Book title exists but the label is missing.
models.py: class Author(models.Model): name = models.CharField(max_length=100) class Book(models.Model): author = models.ForeignKey(Author) title = models.CharField(max_length=100) admin.py: class BookInline(admin.StackedInline): model = Book readonly_fields = ('title',) class AuthorAdmin(admin.ModelAdmin): inlines = (BookInline,) admin.site.register(Author, AuthorAdmin)
Change History (8)
comment:1 Changed 5 years ago by benc
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:2 Changed 5 years ago by russellm
- milestone set to 1.2
- Triage Stage changed from Unreviewed to Accepted
Changed 5 years ago by ptone
comment:4 Changed 5 years ago by anonymous
- Owner changed from nobody to anonymous
- Status changed from new to assigned
comment:5 Changed 5 years ago by gwilson
- Owner changed from anonymous to gwilson
- Status changed from assigned to new