diff options
| author | Tim Graham <timograham@gmail.com> | 2013-06-12 10:15:24 -0700 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-06-12 10:15:24 -0700 |
| commit | 0938970491eee41ccde11bf3efe5b307ced8dba6 (patch) | |
| tree | 7da6bb1f39458302539f476ff9b52158bf8a30f9 /docs | |
| parent | 6e90bfde88136504915533a4f47d5ac043b62a76 (diff) | |
| parent | b79aa796d8fe0d28778605b6b294e3e3a3f9ca65 (diff) | |
Merge pull request #1259 from Wilfred/master
Simplified a formset example in the docs
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/topics/forms/formsets.txt | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/docs/topics/forms/formsets.txt b/docs/topics/forms/formsets.txt index e86a14913d..77341cf55d 100644 --- a/docs/topics/forms/formsets.txt +++ b/docs/topics/forms/formsets.txt @@ -247,8 +247,7 @@ is where you define your own validation that works at the formset level:: ... # Don't bother validating the formset unless each form is valid on its own ... return ... titles = [] - ... for i in range(0, self.total_form_count()): - ... form = self.forms[i] + ... for form in self.forms: ... title = form.cleaned_data['title'] ... if title in titles: ... raise forms.ValidationError("Articles in a set must have distinct titles.") |
