Opened 8 years ago

Closed 8 years ago

#26128 closed New feature (needsinfo)

Colon separate JOIN TYPE in QuerySets.select_related() and QuerySets.prefetch_related()

Reported by: VINAY KUMAR SHARMA Owned by: nobody
Component: Database layer (models, ORM) Version: 1.9
Severity: Normal Keywords: custom join
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


Please use Colon separator to add extra functionality to custom JOIN TYPE during query:


    Car.objects.select_related('car_brand:INNER_JOIN', 'gallery:LEFT_OUTER_JOIN') \

Change History (1)

comment:1 by Tim Graham, 8 years ago

Resolution: needsinfo
Status: newclosed

I don't think that particular API is likely to be accepted. Maybe custom SelectRelated classes as described in #23854 would allow allow your use case? Did you check if the custom Prefech object would work for what you're trying to accomplish there. It's helpful to explain what your use case actually is instead of just proposing some functionality. Another related ticket might be #25590, "Allow fields to set join class". Please have a look through the other "Database layers" tickets and add more details here if you don't any of them will address what you're trying to accomplish. Thanks!

Note: See TracTickets for help on using tickets.
Back to Top