From 5389c0d2afebcee36bdef23a61788eef29374e78 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Mon, 15 Sep 2008 00:07:13 +0000 Subject: [PATCH] Added documentation of the Form class's custom __iter__ method to the forms API reference as well git-svn-id: http://code.djangoproject.com/svn/django/trunk@9031 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/ref/forms/api.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/ref/forms/api.txt b/docs/ref/forms/api.txt index 72dfcb67c9..285d43b01c 100644 --- a/docs/ref/forms/api.txt +++ b/docs/ref/forms/api.txt @@ -530,6 +530,16 @@ string or Unicode object, respectively:: >>> unicode(f['subject']) u'' +Form objects define a custom ``__iter__`` method which allows you to loop +through their fields:: + + >>> f = ContactForm() + >>> for field in f: print field + + + + + The field-specific output honors the form object's ``auto_id`` setting:: >>> f = ContactForm(auto_id=False)