#26706: Reverse many to one and forward many to many managers's prefetch object
cache should be cleared on clear().
-------------------------------------+-------------------------------------
     Reporter:  cosmosgenius         |                    Owner:  yoongkang
         Type:  Bug                  |                   Status:  assigned
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  manytomany m2m       |             Triage Stage:  Ready for
  clear                              |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by yoongkang):

 I just read #25344, thanks, didn't know there were other methods that were
 affected.

 I think the behaviour should be added in both cases. Is it not reasonable,
 in general, to expect the cache to be cleared when you mutate the items?
 If the historical cached list is needed for any reason, it could always be
 stored in a variable.

 I do agree that in either case it should be documented. Either that your
 prefetched values could be out of date, or that any changes via the add(),
 clear() and remove() methods will clear the cache.

 I have updated my patch to cater for add(), remove() in addition to
 clear(). Happy to amend and add documentation either way we go, but I'll
 wait for consensus before adding documentation.

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

Reply via email to