Opened 14 years ago
Closed 14 years ago
#17506 closed Cleanup/optimization (fixed)
Minor tidyup in session DB backend
| Reported by: | FunkyBob | Owned by: | nobody |
|---|---|---|---|
| Component: | contrib.sessions | Version: | dev |
| Severity: | Normal | Keywords: | session |
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | yes | UI/UX: | no |
Description
The ORM docs suggest using exists() can be more efficient than try:get()/except:
Here's a patch to do just that in the session DB backend.
Attachments (2)
Change History (6)
by , 14 years ago
| Attachment: | session_db.patch added |
|---|
comment:1 by , 14 years ago
| Patch needs improvement: | set |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
comment:2 by , 14 years ago
| Patch needs improvement: | unset |
|---|
comment:3 by , 14 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
Note:
See TracTickets
for help on using tickets.
Accepted, but the method needs to actually return the value - with your patch it returns
Nonealways. Once this is fixed the ticket can be marked 'ready for checkin'.