Opened 18 months ago

Closed 18 months ago

Last modified 18 months ago

#21004 closed Cleanup/optimization (wontfix)

Deprecation Timeline: is_managed(): more info needed

Reported by: guettli Owned by: nobody
Component: Documentation Version: 1.5
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


According to the Deprecation Timeline is_manged() and some other APIs get removed:

The following private APIs will be removed: ...

Please provide a link or more info how to update source code.

The django users should know how to use is_managed() with future versions.

Change History (2)

comment:1 Changed 18 months ago by aaugustin

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to wontfix
  • Status changed from new to closed

It's a private API. If you've been using it, you're on your own; that's the deal.

In Django 1.6 you cannot put a connection in managed mode, so is_managed() always returns False. You'll probably end up replacing it by not transaction.get_autocommit(). But more generally you need to account for the new transaction management, which means you need to understand what your code is trying to achieve and what functionality the new transaction management API provides rather than just replace is_managed() by something else.

I can suggest two resources:

  • my talk at DjangoCon in Warsaw gives lots of background on the design of transaction management in Django (both the old one and the new one) — see
  • the transaction management docs contain fairly extensive information about upgrading.

FYI I didn't remove the API outright because I knew it was used into the wild. I made an extra effort to provide a deprecation path. However, that's the extent of what I'm willing to do. Since it's a private API, its purpose and use case weren't documented, and therefore I cannot provide adequate advice in general.

comment:2 Changed 18 months ago by aaugustin

The django users should know how to use is_managed() with future versions.

The answer is very simple: don't, it's going to be removed.

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