#25344: Document that prefetch_related() cache doesn't change unless it's 
refetched
from the database
--------------------------------------+------------------------------------
     Reporter:  TankOs                |                    Owner:  nobody
         Type:  Cleanup/optimization  |                   Status:  new
    Component:  Documentation         |                  Version:  1.8
     Severity:  Normal                |               Resolution:
     Keywords:  prefetch_related      |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------

Comment (by TankOs):

 I agree that it's very difficult (if not impossible) to implement correct
 behavior for all prefetch scenarios. What do you think of disallowing
 adding entities to prefetched fields? Because if adding an entity does not
 reflect that entity in the collection, then it's what causes the most
 confusion, because naturally, when you add things to a container, you
 expect to find it there.

 Personally, I consider prefetched fields as being immutable, so adding
 items to them is not what I'd expect anyway. I'm thinking of an exception
 if the user tries to add entities to a prefetched collection.

 > Feel free to raise the issue on the DevelopersMailingList if you feel
 I'm wrong.

 Can this ticket still be used for discussions?

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

Reply via email to