54 | | == Changed Admin.manager option to more flexible hook == |
55 | | |
56 | | As of [4342], the {{{manager}}} option to {{{class Admin}}} no longer exists. This option was undocumented, but we're mentioning the change here in case you used it. In favor of this option, {{{class Admin}}} may now define one of these methods: |
57 | | |
58 | | * {{{queryset()}}} |
59 | | * {{{queryset_add()}}} |
60 | | * {{{queryset_change()}}} |
61 | | |
62 | | These give you much more flexibility. |
63 | | |
64 | | Note that this change was made to the NewformsAdminBranch. (We initially called the new method {{{change_list_queryset}}}, but this was changed in [4584] to be more flexible.) The change will not be made to trunk until that branch is merged to trunk. |
65 | | |
66 | | == Changed prepopulate_from to be defined in the Admin class, not database field classes == |
67 | | |
68 | | As of [4446], the {{{prepopulate_from}}} option to database fields no longer exists. It's been discontinued in favor of the new {{{prepopulated_fields}}} option on {{{class Admin}}}. The new {{{prepopulated_fields}}} option, if given, should be a dictionary mapping field names to lists/tuples of field names. Here's an example comparing old syntax and new syntax: |
69 | | |
70 | | {{{ |
71 | | #!python |
72 | | |
73 | | # OLD: |
74 | | class MyModel(models.Model): |
75 | | first_name = models.CharField(maxlength=30) |
76 | | last_name = models.CharField(maxlength=30) |
77 | | slug = models.CharField(maxlength=60, prepopulate_from=('first_name', 'last_name')) |
78 | | |
79 | | class Admin: |
80 | | pass |
81 | | |
82 | | # NEW: |
83 | | class MyModel(models.Model): |
84 | | first_name = models.CharField(maxlength=30) |
85 | | last_name = models.CharField(maxlength=30) |
86 | | slug = models.CharField(maxlength=60) |
87 | | |
88 | | class Admin: |
89 | | prepopulated_fields = {'slug': ('first_name', 'last_name')} |
90 | | }}} |
91 | | |
92 | | Note that this change was made to the NewformsAdminBranch. The change will not be made to trunk until that branch is merged to trunk. |
93 | | |
94 | | == Moved admin doc views into django.contrib.admindocs == |
95 | | |
96 | | As of [4585], the documentation views for the Django admin site were moved into a new package, {{{django.contrib.admindocs}}}. |
97 | | |
98 | | The admin docs, which aren't documented very well, were located at {{{docs/}}} in the admin site. They're also linked-to by the "Documentation" link in the upper right of default admin templates. |
99 | | |
100 | | Because we've moved the doc views, you now have to activate admin docs explicitly. Do this by adding the following line to your URLconf: |
101 | | |
102 | | {{{ |
103 | | #!python |
104 | | (r'^admin/doc/', include('django.contrib.admindocs.urls')), |
105 | | }}} |
106 | | |
107 | | Note that this change was made to the NewformsAdminBranch. The change will not be made to trunk until that branch is merged to trunk. |
108 | | |