Răsfoiți Sursa

Fixed #34317 -- Renamed "instance" argument of BaseModelFormSet.save_existing() method.

Bakdolot 2 ani în urmă
părinte
comite
5f3c7b7e1d
2 a modificat fișierele cu 3 adăugiri și 2 ștergeri
  1. 1 1
      django/forms/models.py
  2. 2 1
      docs/releases/5.0.txt

+ 1 - 1
django/forms/models.py

@@ -756,7 +756,7 @@ class BaseModelFormSet(BaseFormSet, AltersData):
         """Save and return a new model instance for the given form."""
         return form.save(commit=commit)
 
-    def save_existing(self, form, instance, commit=True):
+    def save_existing(self, form, obj, commit=True):
         """Save and return an existing model instance for the given form."""
         return form.save(commit=commit)
 

+ 2 - 1
docs/releases/5.0.txt

@@ -240,7 +240,8 @@ backends.
 Miscellaneous
 -------------
 
-* ...
+* The ``instance`` argument of the undocumented
+  ``BaseModelFormSet.save_existing()`` method is renamed to ``obj``.
 
 .. _deprecated-features-5.0: