Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#12809 closed Uncategorized (invalid)

Add returning of parameters for get_from_clause()

Reported by: Kronuz Owned by: nobody
Component: Database layer (models, ORM) Version:
Severity: Normal Keywords: dynamic queries, from
Cc: Kronuz Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Could it be possible to make the get_from_clause() in django.db.models.sql.compiler return params? It'd be useful in some cases to be able to "insert" parameters to the FROM (such as when you need to add an ON clause or other "extended" things)
For an example of this, you can check the "Simple Backend" for the django-fts (at google code), in where I need to "patch" the structures directly to achieve what I wanted (or perhaps there's a better way?)... it's right there in fts.backends.simple, in the _search() method... where I add extra joined tables to do the search (just after the tables already in the queryset). I'd appreciate any comments. :)

Change History (2)

comment:1 Changed 5 years ago by russellm

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

I'm unclear why you can't use the normal query.join() mechanisms to achieve what you want to do. This gives you a great deal of control over the join type, join condition, etc.

comment:2 Changed 4 years ago by Kronuz

  • Cc Kronuz added
  • Easy pickings unset
  • Severity set to Normal
  • Type set to Uncategorized
  • UI/UX unset
Note: See TracTickets for help on using tickets.
Back to Top