#33596: subsequent calls to prefetch_related_objects() don't work for model
instances that have changed
-------------------------------------+-------------------------------------
               Reporter:  Dennis     |          Owner:  nobody
  Kliban                             |
                   Type:  Bug        |         Status:  new
              Component:  Database   |        Version:  3.2
  layer (models, ORM)                |
               Severity:  Normal     |       Keywords:
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 Our project processes instances in a stream. In some cases the instances
 are repeated. In these cases, we discovered that
 prefetch_related_objects() does not work correctly if the list of related
 objects has changed since the first time prefetch_related_objects() on the
 instance. I've written a simple reproducer here[0].

 In the reproducer, if I call `delattr(book, "the_authors")` after adding
 the author, everything works.

 [0]
 
https://github.com/django/django/commit/73a138665ba20915f51680816120727a5e2ba771

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33596>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107017fb308fbaa-9c9ea094-0eea-4a7d-a9bd-2c90cefe7180-000000%40eu-central-1.amazonses.com.

Reply via email to