readonly_fields ignore form field label
|Reported by:||gabomdq@…||Owned by:||nobody|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
class MyForm(ModelForm): test_field_callable = CharField(label=_('This is a test label')) class MyAdmin(ModelAdmin) form = MyForm readonly_fields=['test_field_callable',] class MyModel(Model) def test_field_callable(self): print 'test content'
I'm using the previous pseudo code as a guide to explain what happens, it's not a complete test case. If the field test_field_callable is not listed on readonly_fields, I get the proper label displayed on the Admin. However, with the readonly_fields listing test_field_callable, the label printed is "Test Field Callable" (a beautified version of the field name instead of the label I specified on the form).
Change History (10)
comment:1 Changed 5 years ago by aaugustin
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Accepted