#27280: can-order: 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-order


 {{{
 >>> 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-ORDER': '2',
 ...     'form-1-title': 'Article #2',
 ...     'form-1-pub_date': '2008-05-11',
 ...     'form-1-ORDER': '1',
 ...     'form-2-title': 'Article #3',
 ...     'form-2-pub_date': '2008-05-01',
 ...     'form-2-ORDER': '0',
 ... }

 >>> 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/27280>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/049.953044cacc0012c0db883f3130e63f67%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to