[Django] #24312: Make it possible to import models safely at any time

4 views
Skip to first unread message

Django

unread,
Feb 9, 2015, 4:25:14 PM2/9/15
to django-...@googlegroups.com
#24312: Make it possible to import models safely at any time
----------------------------------------+-----------------------------
Reporter: aaugustin | Owner: nobody
Type: New feature | Status: new
Component: Core (Other) | Version: master
Severity: Normal | Keywords: app-loading
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
----------------------------------------+-----------------------------
Ideally one could safely import models anytime, but they just wouldn't be
available in the app registry or register themselves with the ORM (e.g.
attach related managers to other models) until/unless their app were
installed. (The general principle being that errors on import, or having
to be careful what you import when, is an unfortunate smell due to
reliance on import side effects.)

(copied from https://code.djangoproject.com/ticket/21680#comment:12)

--
Ticket URL: <https://code.djangoproject.com/ticket/24312>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Reply all
Reply to author
Forward
0 new messages