mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
[1.5.x] Fixed #19226 -- Applied linebreaksbr to read-only fields in admin
Thanks shadow for the report, and Melevir and thiderman for the
patch.
Backport of ec9d6b112 from master.
This commit is contained in:
@@ -388,7 +388,10 @@ class PrePopulatedPostAdmin(admin.ModelAdmin):
|
||||
|
||||
class PostAdmin(admin.ModelAdmin):
|
||||
list_display = ['title', 'public']
|
||||
readonly_fields = ('posted', 'awesomeness_level', 'coolness', 'value', lambda obj: "foo")
|
||||
readonly_fields = (
|
||||
'posted', 'awesomeness_level', 'coolness', 'value', 'multiline',
|
||||
lambda obj: "foo"
|
||||
)
|
||||
|
||||
inlines = [
|
||||
LinkInline
|
||||
@@ -402,6 +405,10 @@ class PostAdmin(admin.ModelAdmin):
|
||||
|
||||
def value(self, instance):
|
||||
return 1000
|
||||
|
||||
def multiline(self, instance):
|
||||
return "Multiline\ntest\nstring"
|
||||
|
||||
value.short_description = 'Value in $US'
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user