Loading django/contrib/admin/helpers.py +1 −0 Original line number Diff line number Diff line Loading @@ -216,6 +216,7 @@ class AdminReadonlyField(object): result_repr = ", ".join(map(six.text_type, value.all())) else: result_repr = display_for_field(value, f, self.empty_value_display) result_repr = linebreaksbr(result_repr) return conditional_escape(result_repr) Loading docs/releases/1.8.8.txt +3 −0 Original line number Diff line number Diff line Loading @@ -48,3 +48,6 @@ Bugfixes ``filter_horizontal`` and ``filter_vertical`` widgets, which could result in inadvertent data loss if a user didn't notice that and then submitted the form (:ticket:`22955`). * Fixed a regression in the admin which ignored line breaks in read-only fields instead of converting them to ``<br>`` (:ticket:`25465`). docs/releases/1.9.1.txt +3 −0 Original line number Diff line number Diff line Loading @@ -67,3 +67,6 @@ Bugfixes * Fixed ``isnull`` query lookup for ``ForeignObject`` (:ticket:`25972`). * Fixed a regression in the admin which ignored line breaks in read-only fields instead of converting them to ``<br>`` (:ticket:`25465`). tests/admin_views/admin.py +2 −2 Original line number Diff line number Diff line Loading @@ -387,7 +387,7 @@ class LinkInline(admin.TabularInline): model = Link extra = 1 readonly_fields = ("posted", "multiline") readonly_fields = ("posted", "multiline", "readonly_link_content") def multiline(self, instance): return "InlineMultiline\ntest\nstring" Loading Loading @@ -435,7 +435,7 @@ class PostAdmin(admin.ModelAdmin): readonly_fields = ( 'posted', 'awesomeness_level', 'coolness', 'value', 'multiline', 'multiline_html', lambda obj: "foo", 'multiline_html_allow_tags', 'multiline_html_allow_tags', 'readonly_content', ) inlines = [ Loading tests/admin_views/models.py +2 −0 Original line number Diff line number Diff line Loading @@ -451,6 +451,7 @@ class Link(models.Model): posted = models.DateField(default=link_posted_default) url = models.URLField() post = models.ForeignKey("Post", models.CASCADE) readonly_link_content = models.TextField() class PrePopulatedPost(models.Model): Loading @@ -468,6 +469,7 @@ class PrePopulatedSubPost(models.Model): class Post(models.Model): title = models.CharField(max_length=100, help_text="Some help text for the title (with unicode ŠĐĆŽćžšđ)") content = models.TextField(help_text="Some help text for the content (with unicode ŠĐĆŽćžšđ)") readonly_content = models.TextField() posted = models.DateField( default=datetime.date.today, help_text="Some help text for the date (with unicode ŠĐĆŽćžšđ)" Loading Loading
django/contrib/admin/helpers.py +1 −0 Original line number Diff line number Diff line Loading @@ -216,6 +216,7 @@ class AdminReadonlyField(object): result_repr = ", ".join(map(six.text_type, value.all())) else: result_repr = display_for_field(value, f, self.empty_value_display) result_repr = linebreaksbr(result_repr) return conditional_escape(result_repr) Loading
docs/releases/1.8.8.txt +3 −0 Original line number Diff line number Diff line Loading @@ -48,3 +48,6 @@ Bugfixes ``filter_horizontal`` and ``filter_vertical`` widgets, which could result in inadvertent data loss if a user didn't notice that and then submitted the form (:ticket:`22955`). * Fixed a regression in the admin which ignored line breaks in read-only fields instead of converting them to ``<br>`` (:ticket:`25465`).
docs/releases/1.9.1.txt +3 −0 Original line number Diff line number Diff line Loading @@ -67,3 +67,6 @@ Bugfixes * Fixed ``isnull`` query lookup for ``ForeignObject`` (:ticket:`25972`). * Fixed a regression in the admin which ignored line breaks in read-only fields instead of converting them to ``<br>`` (:ticket:`25465`).
tests/admin_views/admin.py +2 −2 Original line number Diff line number Diff line Loading @@ -387,7 +387,7 @@ class LinkInline(admin.TabularInline): model = Link extra = 1 readonly_fields = ("posted", "multiline") readonly_fields = ("posted", "multiline", "readonly_link_content") def multiline(self, instance): return "InlineMultiline\ntest\nstring" Loading Loading @@ -435,7 +435,7 @@ class PostAdmin(admin.ModelAdmin): readonly_fields = ( 'posted', 'awesomeness_level', 'coolness', 'value', 'multiline', 'multiline_html', lambda obj: "foo", 'multiline_html_allow_tags', 'multiline_html_allow_tags', 'readonly_content', ) inlines = [ Loading
tests/admin_views/models.py +2 −0 Original line number Diff line number Diff line Loading @@ -451,6 +451,7 @@ class Link(models.Model): posted = models.DateField(default=link_posted_default) url = models.URLField() post = models.ForeignKey("Post", models.CASCADE) readonly_link_content = models.TextField() class PrePopulatedPost(models.Model): Loading @@ -468,6 +469,7 @@ class PrePopulatedSubPost(models.Model): class Post(models.Model): title = models.CharField(max_length=100, help_text="Some help text for the title (with unicode ŠĐĆŽćžšđ)") content = models.TextField(help_text="Some help text for the content (with unicode ŠĐĆŽćžšđ)") readonly_content = models.TextField() posted = models.DateField( default=datetime.date.today, help_text="Some help text for the date (with unicode ŠĐĆŽćžšđ)" Loading