mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
[5.0.x] Fixed #35606, Refs #34045 -- Fixed rendering of ModelAdmin.action_checkbox for models with a __html__ method.
Thank you Claude Paroz for the report. Regression in85366fbca7. Backport of182f262b15from main.
This commit is contained in:
committed by
Sarah Boyce
parent
fe9bf0cef5
commit
c3d3af8ea3
@@ -19,6 +19,17 @@ class Child(models.Model):
|
||||
age = models.IntegerField(null=True, blank=True)
|
||||
|
||||
|
||||
class GrandChild(models.Model):
|
||||
parent = models.ForeignKey(Child, models.SET_NULL, editable=False, null=True)
|
||||
name = models.CharField(max_length=30, blank=True)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
def __html__(self):
|
||||
return f'<h2 class="main">{self.name}</h2>'
|
||||
|
||||
|
||||
class Genre(models.Model):
|
||||
name = models.CharField(max_length=20)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user