#8193: `__import__(mod, {}, {}, [''])` causes double import of modules ('module'
and 'module' + '.')
------------------------------------+---------------------------------------
Reporter: i_i | Owner: nobody
Status: new | Milestone: post-1.0
Component: Uncategorized | Version: SVN
Resolution: | Keywords: import
Stage: Accepted | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 1 |
------------------------------------+---------------------------------------
Comment (by mrmachine):
Replying to [comment:5 mtredinnick]:
> Note that this isn't actually a bug, since modules should be able to
handle being imported multiple times in any case. That happens quite a bit
in Django (since `__import__` is equivalent to Python's `reload()`). Thus
this is probably worth doing at some point, but it's not a 1.0
showstopper.
It seems that any module that registers `ModelAdmin` objects cannot handle
being imported multiple times (raises `AlreadyRegistered`. This seems to
happen right now if you've bundled your admin-specific forms, views, and
urls into an admin module instead of an admin.py, it will be imported once
by `admin.autodiscover` and again by `include('myproject.admin.urls')`.
--
Ticket URL: <http://code.djangoproject.com/ticket/8193#comment:12>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---