#4224: First attempt at inter-app dependency tracking
--------------------------------------------------------+-------------------
Reporter: Tim Chase <[EMAIL PROTECTED]> | Owner: adrian
Status: new | Component:
Metasystem
Version: SVN | Keywords:
dependency, INSTALLED_APPS, settings.py
Stage: Unreviewed | Has_patch: 0
--------------------------------------------------------+-------------------
I used a multi-map scheme to track inter-app dependencies. A single
function (dependency_track) walks through a list of desired app names
(SPECIFIED_APPS) and looks up the dependencies in the multi-map
(DEPENDENCIES). Each app and its dependencies (and their sub-
dependencies, and their sub-sub-dependencies, ad infinitum) are added to a
set() object which is finally returned as a tuple() that can be appended
to the INSTALLED_APPS setting to add all the desired modules. My original
post to Django Users:
http://groups.google.com/group/django-
users/browse_thread/thread/c6ee8c5563bd1090/
where Simon G. suggested that I post it as a ticket. He mentioned that
inter-module dependency-tracking had been discussed on the Django
Developers list previously:
http://groups.google.com/group/django-developers/msg/be076ab6855b9b9f
I don't know if this addresses any/all of the issues in that thread. The
proposed solution there was some tuple of dict()s where each dict had the
same pair of name/module which sounds a lot to me like a multi-map would
do the job.
This currently requires that module dependency be tracked in a single file
(I use settings.py) rather than having each app track its own
dependencies. However, it wouldn't be too hard to extend this scheme to
walk through each of the apps listed in the SPECIFIED_APPS and check for a
pre-defined property (the dependency multi-map) and then build a master
DEPENDENCIES multi-map from that source. I haven't thought hard about
which way would be better to do it (tracking in a single file, or sniffing
each of the modules for a pre-defined property and building up
dependencies that way).
It also doesn't try to import them to verify that the proj.appname is a
valid module. But Django will holler if they're not availble when it
needs them.
Feel free to use it or ignore it. I'm not sure if "Metasystem" is quite
the right component, but it seemed the most fitting.
--
Ticket URL: <http://code.djangoproject.com/ticket/4224>
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
-~----------~----~----~----~------~----~------~--~---