#6003: Registration for newforms admin
--------------------------------------------------+-------------------------
Reporter:  Petr Marhoun <[EMAIL PROTECTED]>  |       Owner:  nobody         
  Status:  new                                    |   Component:  Admin 
interface
 Version:  newforms-admin                         |    Keywords:                
 
   Stage:  Unreviewed                             |   Has_patch:  1             
 
--------------------------------------------------+-------------------------
 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".

-- 
Ticket URL: <http://code.djangoproject.com/ticket/6003>
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to