Changes between Version 190 and Version 191 of BackwardsIncompatibleChanges
- Timestamp:
- Jul 19, 2008, 12:23:26 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
BackwardsIncompatibleChanges
v190 v191 715 715 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. 716 716 717 718 717 === Changed Admin.manager option to more flexible hook === 719 718 720 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 a ```queryset``` method:719 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, a {{{ModelAdmin}}} clas may now define a ```queryset``` method: 721 720 722 721 {{{ … … 733 732 === Changed prepopulate_from to be defined in the Admin class, not database field classes === 734 733 735 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 {{{classAdmin}}}. The new {{{prepopulated_fields}}} option, if given, should be a dictionary mapping field names to lists/tuples of field names. This change was made in an effort to remove admin-specific options from the model itself. Here's an example comparing old syntax and new syntax:734 The {{{prepopulate_from}}} option to database fields no longer exists. It's been discontinued in favor of the new {{{prepopulated_fields}}} option in a {{{ModelAdmin}}}. The new {{{prepopulated_fields}}} option, if given, should be a dictionary mapping field names to lists/tuples of field names. This change was made in an effort to remove admin-specific options from the model itself. Here's an example comparing old syntax and new syntax: 736 735 737 736 {{{ … … 763 762 === Moved admin doc views into django.contrib.admindocs === 764 763 765 As of [4585], the documentation views for the Django admin site were moved into a new package, {{{django.contrib.admindocs}}}.764 The documentation views for the Django admin site were moved into a new package, {{{django.contrib.admindocs}}}. 766 765 767 766 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. … … 812 811 === Inline editing === 813 812 814 The syntax is now different and much, much better. 813 We have significantly improved working with inlines. 814 815 815 Here is an example: 816 816 {{{ 817 817 #!python 818 from django.contrib import admin 819 820 class ChildInline(admin.TabularInline): 821 model = Child 822 extra = 3 823 824 class ParentAdmin(admin.ModelAdmin): 825 model = Parent 826 inlines = [ChildInline] 827 }}} 828 See [http://code.djangoproject.com/browser/django/branches/newforms-admin/docs/admin.txt#L506 this documentation] for more details on field options for inline classes 818 819 # OLD: 820 821 class Author(models.Model): 822 name = models.CharField(max_length=100) 823 824 class Book(models.Model): 825 author = models.ForeignKey(Author, edit_inline=models.TABULAR) 826 title = models.CharField(max_length=100) 827 828 # NEW: 829 # no longer need the edit_inline database field option above. just remove it. 830 831 from django.contrib import admin 832 833 class BookInline(admin.TabularInline): 834 model = Book 835 extra = 3 836 837 class AuthorAdmin(admin.ModelAdmin): 838 inlines = [BookInline] 839 840 admin.site.register(Author, AuthorAdmin) 841 }}} 842 843 Before you would define an {{{edit_inline}}} database field option and give it the value of the type of inline you wanted, either {{{models.TABULAR}}} or {{{models.STACKED}}}. This is now done with classes and gives you much more flexibility over the options of a specific inline. See [http://www.djangoproject.com/documentation/admin/#inlinemodeladmin-objects the inlines documentation] to learn more. 829 844 830 845 === Refactored inner Admin ```js``` option to media definitions === … … 901 916 === ```django.contrib.auth``` is now using newforms === 902 917 903 In [7191] ```django.contrib.auth``` has been converted to use newforms as 904 opposed to using oldforms. If you are relying on the oldforms, you will need 905 to modifyyour code/templates to work with newforms.918 ```django.contrib.auth``` has been converted to use newforms as opposed to 919 using oldforms. If you are relying on the oldforms, you will need to modify 920 your code/templates to work with newforms. 906 921 907 922 === Moved radio_admin from the model definition ===