#19190: Refactor sql.query.select and select_fields
-------------------------------------+-------------------------------------
               Reporter:  akaariai   |          Owner:  nobody
                   Type:             |         Status:  new
  Cleanup/optimization               |        Version:  master
              Component:  Database   |       Keywords:
  layer (models, ORM)                |      Has patch:  1
               Severity:  Normal     |    Needs tests:  0
           Triage Stage:             |  Easy pickings:  0
  Unreviewed                         |
    Needs documentation:  0          |
Patch needs improvement:  0          |
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 I introduced some major gis regressions in commit
 [f64a5ef404cb6fd28e008a01039a3beea2fa8e1b] - a fix for #19102. The reason
 for the regressions was that Query.select and select_fields must be in
 sync, but this applies only to gis backend. The commit did:
 {{{
 qs.select = [something]
 }}}
 while it should have done:
 {{{
 qs.select, qs.select_fields = [something], [None]
 }}}

 The qs.select and select_fields must always be edited in sync for gis to
 work. There are not even comments explaining how select and select_fields
 work currently.

 I have implemented
 [https://github.com/akaariai/django/compare/rm_select_fields a refactor
 for this] which removes select_fields and collapses it into qs.select.
 This way it will be impossible to do the same mistake I did in future.

 It seems similar refactoring should be done for
 related_select_cols/related_select_fields.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/19190>
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to