Opened 7 years ago

Closed 5 years ago

#7874 closed New feature (fixed)

Transactions should support the context handler interface

Reported by: kcarnold Owned by: nobody
Component: Database layer (models, ORM) Version: master
Severity: Normal Keywords:
Cc: kenneth.arnold@… Triage Stage: Design decision needed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX:


(Low-priority, post-1.0)

Python 2.5 (really 2.6) introduces a with statement (

It would be nice for transactions to support that, so a casual transaction use doesn't require creating a "dummy" function just to wrap it with a decorator.

This can be done entirely backwards-compatibly by adding __enter__ and __exit__ functions.

Change History (5)

comment:1 Changed 7 years ago by mir

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

This is going to need a discussion, but certainly not before the 1.0 release. If you want, could you please post a message to django-developers some time after the 1.0 release?

comment:2 Changed 7 years ago by kcarnold

  • Cc kenneth.arnold@… added

comment:3 Changed 7 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

comment:4 Changed 5 years ago by lukeplant

  • Severity set to Normal
  • Type set to New feature

comment:5 Changed 5 years ago by anonymous

  • Easy pickings unset
  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.
Back to Top