Changes between Version 58 and Version 59 of NewformsAdminBranch
- Timestamp:
- Jul 9, 2008, 12:27:11 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
NewformsAdminBranch
v58 v59 44 44 from django.contrib import admin 45 45 46 admin.autodiscover() 47 46 48 urlpatterns = patterns('', 47 49 (r'^admin/(.*)', admin.site.root), … … 50 52 51 53 Note that, in this above URLconf example, we're dealing with the object {{{django.contrib.admin.site}}}. This is an instance of {{{django.contrib.admin.AdminSite}}}, which is a class that lets you specify admin-site functionality. The object {{{django.contrib.admin.site}}} is a default {{{AdminSite}}} instance that is created for you automatically, but you can also create other instances as you see fit. 54 55 We use the {{{admin.autodiscover()}}} call above to force the import of the {{{admin.py}}} module of each {{{INSTALLED_APPS}}} entry. This won't be needed if you use your own {{{AdminSite}}} instance since you will likely be importing those modules explicily in a project-level {{{admin.py}}}. This was added in [7872]. 52 56 53 57 Previously, there was one "global" version of the admin site, which used all models that contained a {{{class Admin}}}. This new scheme allows for much more fine-grained control over your admin sites, allowing you to have multiple admin sites in the same Django instance. … … 353 357 filter_horizontal = ('field2',) 354 358 }}} 359