Code

Opened 8 years ago

Closed 8 years ago

#2394 closed defect (wontfix)

count() QuerySet method should accept lookup parameters

Reported by: Gary Wilson <gary.wilson@…> Owned by: adrian
Component: Database layer (models, ORM) Version: master
Severity: normal Keywords:
Cc: gary.wilson@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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)

Attachments (0)

Change History (1)

comment:1 Changed 8 years ago by adrian

  • Resolution set to wontfix
  • Status changed from new to closed

I'm -0 on this, because it introduces more than one way to do the same thing.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.