#27280: can_order/can_delete documentation examples don't require initial data
-------------------------------------+-------------------------------------
     Reporter:  Kifsif               |                    Owner:  nobody
         Type:                       |                   Status:  closed
  Cleanup/optimization               |
    Component:  Documentation        |                  Version:  1.10
     Severity:  Normal               |               Resolution:  invalid
     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:7 Tim Graham]:
 > It is necessary. Going back to my first comment on the ticket: "you
 should pass the same `initial` when processing formset data so that
 `form.has_changed()` works properly."

 Please, look here. Answer one particular question: is initial data
 misleading here or not? If it is, let's change something.
 I think it is. We are illustrating can_order/can delete. This means that
 we should isolate and demonstrate these two particular phenomena.

 has_changed() was demonstrated somewhere earlier. But almost immediately
 after that demonstration we can see:
 formset = ArticleFormSet(data)

 It was 3-5 lines later. Namely here:
 https://docs.djangoproject.com/en/1.10/topics/forms/formsets
 /#understanding-the-managementform


 Then again formset = ArticleFormSet(data) here:
 https://docs.djangoproject.com/en/1.10/topics/forms/formsets/#custom-
 formset-validation

 And close to the end of the article we are demonstrating can_delete. And
 somehow we can't help but insert initial data. For some reason we remember
 that the article should be consistent with the first "has_changed()"
 example.

 Once more: this example is misleading. You closed the ticket. Let it be at
 least open for other people to express their opinion.

--
Ticket URL: <https://code.djangoproject.com/ticket/27280#comment:8>
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/064.98ab6f182ac9d387e6de8bbc3a5e9749%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to