Opened 12 years ago

Closed 12 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)

session_db.patch (581 bytes ) - added by FunkyBob 12 years ago.
session_db-1.patch (588 bytes ) - added by FunkyBob 12 years ago.
Fixed as requested

Download all attachments as: .zip

Change History (6)

by FunkyBob, 12 years ago

Attachment: session_db.patch added

comment:1 by Luke Plant, 12 years ago

Patch needs improvement: set
Triage Stage: UnreviewedAccepted

Accepted, but the method needs to actually return the value - with your patch it returns None always. Once this is fixed the ticket can be marked 'ready for checkin'.

by FunkyBob, 12 years ago

Attachment: session_db-1.patch added

Fixed as requested

comment:2 by anonymous, 12 years ago

Patch needs improvement: unset

comment:3 by Claude Paroz, 12 years ago

Triage Stage: AcceptedReady for checkin

comment:4 by Julien Phalip, 12 years ago

Resolution: fixed
Status: newclosed

In [17390]:

Fixed #17506 -- Did a minor optimization in the sessions' database backend. Thanks to FunkyBob for the report and patch.

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