Opened 3 years ago

Closed 3 years ago

#26568 closed Cleanup/optimization (duplicate)

in_bulk when run on a query set should not need a list of IDs

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


in_bulk provides a great shortcut for getting a primary key dictionary for accessing objects randomly without hitting the database repeatedly. However, for some use case it has been designed as a manager function which takes a list of PKs. But when it is run on a query set, by default it should just return that very query set in a dictionary form (sort of obvious isn't it?)

Change History (1)

comment:1 Changed 3 years ago by Tim Graham

Component: UncategorizedDatabase layer (models, ORM)
Resolution: duplicate
Status: newclosed
Type: BugCleanup/optimization

Duplicate of #8065 (fixed in Django 1.10).

Note: See TracTickets for help on using tickets.
Back to Top