Re: [Django] #27280: can-order: we don't use initial data

2016-09-28 Thread Django
#27280: can-order: we don't use initial data
-+-
 Reporter:  Kifsif   |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Documentation|  Version:  1.10
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Kifsif):

 Replying to [comment:1 Tim Graham]:
 > I'm not sure about that suggestion. The initial is needed for the
 previous code block on the page and generally you should pass the same
 `initial` when processing formset data so that `form.has_changed()` works
 properly.

 Does "initial" illustrate "can_order"? If not, it misleads the user of the
 documentation. If one sees a parameter in the example, one supposes that
 it is vitally necessary for the method they are interested in. This is not
 a book. This is documentation.

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.4c778f174778fa593378fa5a57bee6d3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27280: can-order: we don't use initial data

2016-09-27 Thread Django
#27280: can-order: we don't use initial data
-+-
 Reporter:  Kifsif   |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Documentation|  Version:  1.10
 Severity:  Normal   |   Resolution:
 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):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 I'm not sure about that suggestion. The initial is needed for the previous
 code block on the page and generally you should pass the same `initial`
 when processing formset data so that `form.has_changed()` works properly.

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.6e414becd1538b94f774b6a2f11edccb%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #27280: can-order: we don't use initial data

2016-09-27 Thread Django
#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: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
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.