Opened 12 years ago

Closed 12 years ago

Last modified 10 years ago

#12809 closed Uncategorized (invalid)

Add returning of parameters for get_from_clause()

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


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 12 years ago by Russell Keith-Magee

Resolution: invalid
Status: newclosed

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 10 years ago by German M. Bravo

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