[Django] #27281: can-delete: we don't use initial data

8 views
Skip to first unread message

Django

unread,
Sep 27, 2016, 11:58:33 AM9/27/16
to django-...@googlegroups.com
#27281: can-delete: we don't use initial data
--------------------------------------+--------------------
Reporter: Kifsif | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: 1.10
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+--------------------
https://docs.djangoproject.com/en/1.10/topics/forms/formsets/#can-delete


{{{
>>> data = {
... 'form-TOTAL_FORMS': '3',
... 'form-INITIAL_FORMS': '2',
... 'form-MAX_NUM_FORMS': '',
... 'form-0-title': 'Article #1',
... 'form-0-pub_date': '2008-05-10',
... 'form-0-DELETE': 'on',
... 'form-1-title': 'Article #2',
... 'form-1-pub_date': '2008-05-11',
... 'form-1-DELETE': '',
... 'form-2-title': '',
... 'form-2-pub_date': '',
... 'form-2-DELETE': '',
... }

>>> formset = ArticleFormSet(data, initial=[
... {'title': 'Article #1', 'pub_date': datetime.date(2008, 5, 10)},
... {'title': 'Article #2', 'pub_date': datetime.date(2008, 5, 11)},
... ])
}}}


We don't use initial data here. It overburdens the documentation.

Offer: formset = ArticleFormSet(data)

--
Ticket URL: <https://code.djangoproject.com/ticket/27281>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 27, 2016, 2:26:43 PM9/27/16
to django-...@googlegroups.com
#27281: can-delete: we don't use initial data
-------------------------------------+-------------------------------------
Reporter: Kifsif | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
Component: Documentation | Version: 1.10
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* status: new => closed
* needs_better_patch: => 0
* resolution: => duplicate
* needs_tests: => 0
* needs_docs: => 0


Comment:

As noted in #27280, I'm not sure the suggestion is correct. Anyway, we can
discuss it there and make this change as part of that ticket if I'm wrong.

--
Ticket URL: <https://code.djangoproject.com/ticket/27281#comment:1>

Reply all
Reply to author
Forward
0 new messages