#13386: Change name of ```ModelAdmin.prepopulated_fields``` to ```prepopulated_slug_fields``` to better reflect the actual purpose ----------------------------------+----------------------------------------- Reporter: shanx | Owner: nobody Status: new | Milestone: Component: django.contrib.admin | Version: SVN Keywords: | Stage: Unreviewed Has_patch: 0 | ----------------------------------+----------------------------------------- The ```ModelAdmin.prepopulated_fields``` documentation now states:
{{{ When set, the given fields will use a bit of JavaScript to populate from the fields assigned. The main use for this functionality is to automatically generate the value for SlugField fields from one or more other fields. The generated value is produced by concatenating the values of the source fields, and then by transforming that result into a valid slug (e.g. substituting dashes for spaces). }}} See: http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.prepopulated_fields This option is not a solution for using javascript in general to prepopulate fields in the admin, but is specifically designed for use with ```SlugField``` and autopopulating this type of field. Because of this specific use I propose to rename the option in a future version of Django to better clarify the intended use of this option. A more logical naming would be: ```prepopulated_slug_fields``` So instead of: {{{ #!python class ArticleAdmin(admin.ModelAdmin): prepopulated_fields = {"slug": ("title",)} }}} One would use: {{{ #!python class ArticleAdmin(admin.ModelAdmin): prepopulated_slug_fields = {"slug": ("title",)} }}} -- Ticket URL: <http://code.djangoproject.com/ticket/13386> Django <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 django-upda...@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.