#14270 closed Cleanup/optimization (fixed)
ManyToMany manager classes should be cached
Reported by: | Alex Gaynor | Owned by: | nobody |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | 1.2 |
Severity: | Normal | Keywords: | |
Cc: | real.human@… | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Right now they are created every time an m2m relationship is accessed, this class should be cached.
Attachments (3)
Change History (8)
comment:1 by , 14 years ago
Triage Stage: | Unreviewed → Accepted |
---|
by , 14 years ago
Attachment: | django-m2m-cleanup.diff added |
---|
comment:2 by , 14 years ago
Severity: | → Normal |
---|---|
Type: | → Cleanup/optimization |
comment:3 by , 13 years ago
Cc: | added |
---|---|
Easy pickings: | unset |
UI/UX: | unset |
by , 13 years ago
Attachment: | 14270-m2m-cleanup-r16522.diff added |
---|
Updated to apply cleanly on r16522.
comment:4 by , 13 years ago
This change has the added benefit of exposing the related instance on the related objects manager for reverse relationships, which makes it possible to implement a userland update_or_create()
, for example, and other methods that might need access to the related instance to work correctly or efficiently.
Thanks.
Note:
See TracTickets
for help on using tickets.
patch from Alex Gaynor