﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
6003	Registration for newforms admin	Petr Marhoun <petr.marhoun@…>	nobody	"Some points to registration for newforms admin:
 * One project can have many application, one application can be part of many projects.
 * One project can have several admins.
 * One application can be used in several admins from one project.
 * One application can be registered in one project and not registered in another project. 
 * One application can be used with default !ModelAdmin in one project but with unknown customatization in another project.
 * Explicit is better than implicit, magic is evil.

I would like to propose new conventions. There would be new files admin.py in some applications with method register. Example:

{{{
#!python
from django.contrib import admin
from django.contrib.sites import models

class SiteAdmin(admin.ModelAdmin):
    list_display = ('domain', 'name')
    search_fields = ('domain', 'name')

def register(site):
    site.register(models.Site, SiteAdmin)
}}}

There would be admin.py in each project. Example:

{{{
#!python
from django.contrib import admin

# Import admins from your or contrib applications.
from django.contrib.auth import admin as auth_admin
from django.contrib.sites import admin as sites_admin

# Register admins from your or contrib applications.
admin_site = admin.AdminSite()
auth_admin.register(admin_site)
sites_admin.register(admin_site)
}}}

And it would be called from urls.py. Example:

{{{
#!python
from django.conf.urls.defaults import *

import admin

urlpatterns = patterns('',
    ('^admin/(.*)', admin.admin_site.root),
)
}}}

I say ""is"" but I mean ""convention is""."		closed	contrib.admin	newforms-admin		fixed	nfa-blocker		Accepted	1	0	0	0	0	0
