On 1/18/06, Joseph Kocherhans <[EMAIL PROTECTED]> wrote:
> This is a pretty nice idea. How would the syntax look in INSTALLED_APPS?

INSTALLED_APPS = (
    'django.contrib.admin',
    ('myapp.admin', 'myadmin'),
)

I'm +1 on this one; Existing behaviour is unaffected, new behaviour makes sense without being completely obscure.

+0 to the use of tuples across the board, and -0 on the use of an AS keyword in the string.

Another option would be to allow a dictionary for INSTALLED_APPS:

INSTALLED_APPS = {
    'admin': 'django.contrib.admin ',
    'myadmin': 'myapp.admin'
}

but this requires explicit naming of all apps (possibly a good thing - the 'pick the last name in the namespace' approach always struck me as slightly magical). Alternatively (or in addition), use a tuple on the None key for apps that you want to use the 'default' name:

INSTALLED_APPS = {
    None: ('django.contrib.admin', 'myadmin.otherapp')
    'myadmin': 'myapp.admin'
}

would yield admin, otherapp and myadmin applications. Either way, the existing behaviour of a list/tuple could be preserved in addition to this dictionary syntax, with Django doing the right thing as appropriate.

Russ Magee %-)

Reply via email to