#27414: Document that aliasing ForeignKey fields in F expressions returns pk
values, not model instances
--------------------------------------+------------------------------------
     Reporter:  MikiSoft              |                    Owner:  nobody
         Type:  Cleanup/optimization  |                   Status:  new
    Component:  Documentation         |                  Version:  1.10
     Severity:  Normal                |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------

Comment (by Josh Smeaton):

 (I lost the original comment I wrote here so here's a condensed version).

 Using a ForeignKey as the output_field is an interesting idea that I
 hadn't considered, and would solve any backward compatibility issues. I
 don't know what the difficulty would be, but F fields already have access
 to the query to add necessary joins. I doubt foreign key fields are added
 to joins right yet, but __underscore relationships do add joins to the
 query. The next hard thing would be reconstructing the object.

 All of this sounds doable though.

--
Ticket URL: <https://code.djangoproject.com/ticket/27414#comment:3>
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/066.d86bad6a0b5c9cd3df6472104a9bd3a2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to