#27554: Queryset evaluation fails with mix of nested and flattened prefetches
(AttributeError on RelatedManager)
-------------------------------------+-------------------------------------
     Reporter:  Anthony Leontiev     |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  1.10
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  prefetch             |             Triage Stage:  Accepted
  AttributeError prefetch_related    |
  nested RelatedManager              |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by vimarshc):

 Hey,

 Just finished "bisecting the exact commit which introduced the
 regression".
 Posting my results here.

 Git output:
 {{{
 bdbe50a491ca41e7d4ebace47bfe8abe50a58211 is the first bad commit
 commit bdbe50a491ca41e7d4ebace47bfe8abe50a58211
 Author: François Freitag <francois.frei...@polyconseil.fr>
 Date:   Sun Jan 10 17:54:57 2016 +0100

     Fixed #25546 -- Prevented duplicate queries with nested
 prefetch_related().

 :040000 040000 5ad2af54d2f98566bbfdc23e04493e4c98262568
 f3488a5f680bc5d4b18249aed299b6abd5f86de9 M      django
 :040000 040000 59faff56062b7a347956e24315e12beeb5c7d704
 c4a686067f06b7056dafffa1013bfe3c018c5e52 M      tests
 bisect run success

 }}}

 I'll start trying to locate and fix the bug. I'll request the bug be
 assigned to me once I'm confident I can resolve the issue.
 I'm attaching a directory with the models and tests inside it.
 This directory was inside the tests directory.
 I've written three test cases out of which 2 are passing and one is
 failing. (the one that is failing is
 "test_case_for_nested_and_flat_prefetches")

 [https://github.com/vimarshc/django Here] is a link to the django repo I
 forked and I've pushed the aforementioned tests here too if someone wants
 to get them from here.
 They're on the nested-bug-1.10 branch.

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

Reply via email to