浏览代码

Fixed #30321 -- Added example of changed_data to forms docs.

Bruno Furtado 6 年之前
父节点
当前提交
571ab44e8a
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      docs/ref/forms/api.txt

+ 2 - 0
docs/ref/forms/api.txt

@@ -299,6 +299,8 @@ provided in :attr:`~Form.initial`. It returns an empty list if no data differs.
     >>> f = ContactForm(request.POST, initial=data)
     >>> if f.has_changed():
     ...     print("The following fields changed: %s" % ", ".join(f.changed_data))
+    >>> f.changed_data
+    ['subject', 'message']
 
 Accessing the fields from the form
 ==================================