#25569: Add a friendly error report when using select_related() on a reverse
relation
-------------------------------------+-------------------------------------
               Reporter:  shaib      |          Owner:  nobody
                   Type:  New        |         Status:  new
  feature                            |
              Component:  Database   |        Version:  1.8
  layer (models, ORM)                |
               Severity:  Normal     |       Keywords:
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  1          |    Needs tests:  1
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 Since 1.8, if you refer to a non-existent field in `select_related()`, you
 get an error where the code used to pass silently. One potentially common
 source for such errors is attempts to use `select_related()` on reverse
 relations -- up to 1.7, this would have seemed to work, with 1.8 it
 breaks.

 I think it would be friendlier to users upgrading from (<=) 1.7 if the
 error report called this situation out explicitly, rather than referring
 to reverse relations as "non-existent".

 Not sure if this merits a backport to 1.8.x -- on the one hand, it doesn't
 really fall under the criteria, on the other hand, I think it would be
 very useful and many people will be coming over to 1.8 and stay there, and
 the validation of `select_related()` itself is a new feature in 1.8.

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

Reply via email to