#29262: Custom Left Outer Join in Queries
-------------------------------------+-------------------------------------
     Reporter:  Sassan Haradji       |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Database layer       |                  Version:  2.0
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  ORM Join             |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Sassan Haradji):

 1. I like many need LEFT OUTER JOIN not INNER JOIN, if INNER JOIN was an
 efficient alternative to LEFT OUTER JOIN django itself would use it in its
 foreignkey joins, these joins don't do same thing and aren't an
 alternative for eachother.

 2. This is one from "10 years ago":
 https://code.djangoproject.com/ticket/7231

 3. `.raw()` may be good for some use cases, but I don't get it why should
 I lose all the features on a normal query (like count, filter, etc) just
 cause I wanna add a simple column by an outer join to that normal query.
 What I suggested as an "at least alternative" was an escape hatch that
 lets developer use normal queries (not raw queries) and patch them.
 A framework is just a tool in hands of the developer, I think everyone on
 earth trying to build a tool should consider that the tool should not
 limit its users, but it should give him new opportunities. Django provides
 lots of opportunities, but not providing an easy way to patch final sql it
 compiles is not a good thing. There are hard ways, I can subclass
 connection and query and change their behavior but there should be an easy
 way to do it after all (even if django supports left outer join). In
 documentation it should try to convince normal users to not use it and
 talk about security problems and instabilities it may introduce to code.
 But if someone needs it and knows what he's doing, then he should be able
 to do it.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29262#comment:2>
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/065.a87de363ecc98c017fdacc3376caad49%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to