#18244: example in django formsets doesn't work
---------------------------------+--------------------
Reporter: pedropaulosbs@… | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: 1.3
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------
tried the example available at
https://docs.djangoproject.com/en/dev/topics/forms/formsets/#formset-
validation. the method "has_changed" should return True or False but
instead, raise an exception.
{{{
Python 2.7.3 (default, Apr 20 2012, 22:44:07)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from django import forms
>>> class ArticleForm(forms.Form):
... title = forms.CharField()
... pub_date = forms.DateField()
...
>>> from django.forms.formsets import formset_factory
>>> ArticleFormSet = formset_factory(ArticleForm)
>>> data = {
... 'form-TOTAL_FORMS': u'2',
... 'form-INITIAL_FORMS': u'0',
... 'form-MAX_NUM_FORMS': u'',
... 'form-0-title': u'Test',
... 'form-0-pub_date': u'1904-06-16',
... 'form-1-title': u'Test',
... 'form-1-pub_date': u'',
... }
>>> formset = ArticleFormSet(data)
>>> formset.has_changed()
Traceback (most recent call last):
File "<console>", line 1, in <module>
AttributeError: 'ArticleFormFormSet' object has no attribute 'has_changed'
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/18244>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.