Opened 18 years ago
Closed 18 years ago
#2394 closed defect (wontfix)
count() QuerySet method should accept lookup parameters
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | normal | Keywords: | |
Cc: | gary.wilson@… | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When lookup parameters are passed to count()
, count()
should do an implied filter()
.
For example, the following should be identical:
User.objects.filter(pk=1).count() User.objects.count(pk=1)
Note:
See TracTickets
for help on using tickets.
I'm -0 on this, because it introduces more than one way to do the same thing.