+1000! I think it's an elegant solution to the stated problem, and would be immensely useful on its own merits regardless. For example, I'm using Django to write a lot of custom business logic for an intranet, and I've already run into the dependencies issue; being able to explicitly state them and have django-admin take them into account would save me a *lot* of headaches.
Regards, Jeff On Dec 20, 2005, at 10:24 PM, Adrian Holovaty wrote:
I've been wanting to make the "core" and "auth" models optional for installation, effectively removing the "django-admin.py init" command and requiring people to install "core" and "auth" explicitly. Reasoning: It's messy for the framework to create database tables that everybody doesn't necessarily use. For instance, if somebody doesn't use the admin or need support for users, the auth app is completely unnecessary. Sames goes for the stuff in the "core" app. I have seen this criticism come up from a couple of people. However, we shouldn't make it any harder to get started using Django -- and having to install "core" and "auth" would require extra steps that aren't currently necessary. So a solution that Jacob and I came up with is introducing app dependencies. The admin app, for instance, is dependent on auth and core. The auth app is dependent on core. There are many apps in Ellington (the World Online commercial CMS built on Django) that depend on other ones. A dependency system would solve two problems: * Having to know which order to install things in. * Having to install all the dependencies before you install an app (e.g. installing auth before admin). Hence, instead of the tutorial saying "django-admin.py init", it would say "django-admin.py install admin", which would automatically install the auth app and anything else that's needed. So how is this implemented? The simplest way we could do it is a __dependencies__ variable in the __init__.py of the app. For example, this would go in django/contrib/admin/__init__.py: __dependencies__ = ('django.contrib.auth',) (This assumes auth gets moved to django.contrib.auth rather than being special-cased in django/models.) Adrian -- Adrian Holovaty holovaty.com | djangoproject.com | chicagocrime.org
-- Jeffrey E. Forcier Junior Developer, Research and Development Stroz Friedberg, LLC 15 Maiden Lane, 12th Floor New York, NY 10038 [main]212-981-6540 [direct]212-981-6546 http://www.strozllc.com This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No right to confidential or privileged treatment of this message is waived or lost by any error in transmission. If you have received this message in error, please immediately notify the sender by e-mail or by telephone at 212.981.6540, delete the message and all copies from your system and destroy any hard copies. You must not, directly or indirectly, use, disclose, distribute, print or copy any part of this message if you are not the intended recipient.