Anonymous avatar Anonymous committed 39db8e2

Document FieldList better

Comments (0)

Files changed (2)

 
 .. autoclass:: FieldList(unbound_field, default field arguments, min_entries=0, max_entries=None)
 
-    **Note**: Due to a limitation in how HTML sends values, FieldList cannot enclose 
+    **Note**: Due to a limitation in how HTML sends values, FieldList cannot enclose
     :class:`BooleanField` or :class:`SubmitField` instances.
 
+    .. automethod:: append_entry([data])
+    .. automethod:: pop_entry
+
+    .. attribute:: entries
+
+        Each entry in a FieldList is actually an instance of the field you
+        passed in. Iterating, checking the length of, and indexing the
+        FieldList works as expected, and proxies to the enclosed entries list.
+
+        **Do not** resize the entries list directly, this will result in
+        undefined behavior. See `append_entry` and `pop_entry` for ways you can
+        manipulate the list.
+
+    .. automethod:: __iter__
+    .. automethod:: __len__
+    .. automethod:: __getitem__
+
+
     :class:`FieldList` is not limited to enclosing simple fields; and can
     indeed represent a list of enclosed forms by combining FieldList with
     FormField::

wtforms/fields.py

         return field
 
     def append_entry(self, data=_unset_value):
-        """Create a new entry with optional default data"""
+        """
+        Create a new entry with optional default data.
+
+        Entries added in this way will *not* receive formdata however, and can
+        only receive object data.
+        """
         return self._add_entry(data=data)
 
     def pop_entry(self):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.