Opened 16 years ago
Closed 12 years ago
#10702 closed New feature (wontfix)
.extra() should accept "having" parameter
Reported by: | Carl Meyer | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | kelmens@…, bas@… | Triage Stage: | Design decision needed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Now that we can construct ORM queries with aggregates, it would be nice if the .extra() queryset method accepted a "having" parameter. It would work just like the current "where" parameter; would probably need an associated "having_params" argument, too.
Change History (11)
comment:1 by , 16 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
comment:2 by , 16 years ago
comment:3 by , 15 years ago
@Alex I know that new QuerySet _methods_ that map directly to SQL implementation have often been rejected (with good reason, IMO), but extra() is in a different category: it's already tied directly to SQL terms and implementations. This proposal doesn't change the nature of extra(), just fleshes out its functionality.
comment:4 by , 15 years ago
Cc: | added |
---|
comment:5 by , 15 years ago
whats the use of being able use aggregates and not being able to set a having cause?
why is after a year still a "Design decision needed"?
comment:6 by , 15 years ago
Cc: | added |
---|
comment:7 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → New feature |
comment:10 by , 12 years ago
3 years and this still isn't fixed?
So people on mysql can use extra to specify extra params, but the only way to do filtering on those is via the HAVING clause, as the WHERE clause isn't aware of those params.
So if comment #1 is correct, and this was rejected for some ridiculous reason, then it almost looks like explicitly targeting mysql users, as other db users can use the standard extra(where=...) to handle filtering, but mysql users are denied access to HAVING because of one asshole with a head full of bad decisions, who probably didn't even understand the ramifications of his actions.
So for mysql users, there is NO WAY TO FILTER USING THE PARAMS DEFINED IN EXTRA. Is this more or less correct? And no one has any intention of fixing it?
Isn't that precious!
comment:11 by , 12 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
We've generally been in the direction of restricting (and hopefully) removing extra()
, rather than expanding it. Therefore wontfixing this.
I am almost positive I saw malcolm reject a similar suggestion before, however since I can't find it I'm going to mark as DDN.