1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #34925 -- Prevented Model.refresh_from_db() from mutating list of fields.

This commit is contained in:
trontelj
2023-10-28 00:24:09 +02:00
committed by Mariusz Felisiak
parent 1c6e8ec4ed
commit b0ec87b857
3 changed files with 16 additions and 5 deletions

View File

@@ -38,6 +38,9 @@ class SelfRef(models.Model):
related_name="+",
)
article = models.ForeignKey(Article, models.SET_NULL, null=True, blank=True)
article_cited = models.ForeignKey(
Article, models.SET_NULL, null=True, blank=True, related_name="cited"
)
def __str__(self):
# This method intentionally doesn't work for all cases - part