Changes between Version 49 and Version 50 of NewformsAdminBranch
- Timestamp:
- Jun 27, 2008, 10:35:33 AM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
NewformsAdminBranch
v49 v50 115 115 In this example, the admin options still live in the {{{models.py}}} file. But there's nothing that requires them to do so. The only requirement is that the {{{register()}}} calls are executed at some point, and putting them in the {{{models.py}}} is an easy way to ensure that. We'll likely come up with a nice convention for this.[[BR]] 116 116 117 '''A propos alconvention''': Specifying all admin options in a file called {{{admin.py}}}, and import it in the {{{__init__.py}}} file of your application module to do the registering during the initialization.117 '''A proposed convention''': Specifying all admin options in a file called {{{admin.py}}}, and import it in the {{{__init__.py}}} file of your application module to do the registering during the initialization. 118 118 119 119 You'll notice the {{{BookAdmin}}} class looks a lot like the old-style {{{class Admin}}}. Almost all of the old {{{class Admin}}} options work exactly the same, with one or two exceptions. (For the options that have changed, we've made them '''much''' more powerful.) In addition to the classic options such as {{{list_display}}} and {{{ordering}}}, the {{{ModelAdmin}}} class introduces a wealth of extra hooks you can use to customize the admin site for that particular model. For example: