mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
[1.11.x] Fixed #27998, #28543 -- Restored logging of ManyToManyField changes in admin's object history.
And prevented ManyToManyField initial data in model forms from being affected by subsequent model changes. Regression in 56a55566a791a11420fe96f745b7489e756fc931. Partial backport ofe5bd585c6eand15b465c584from master
This commit is contained in:
@@ -611,6 +611,13 @@ class Pizza(models.Model):
|
||||
toppings = models.ManyToManyField('Topping', related_name='pizzas')
|
||||
|
||||
|
||||
# Pizza's ModelAdmin has readonly_fields = ['toppings'].
|
||||
# toppings is editable for this model's admin.
|
||||
class ReadablePizza(Pizza):
|
||||
class Meta:
|
||||
proxy = True
|
||||
|
||||
|
||||
class Album(models.Model):
|
||||
owner = models.ForeignKey(User, models.SET_NULL, null=True, blank=True)
|
||||
title = models.CharField(max_length=30)
|
||||
|
||||
Reference in New Issue
Block a user