Since Django 1.2.1 'prepopulated_fields' won't prepopulate in the admin.
prepopulated_fields = {'slug': ('title',)}
doesn't seem to work since uploading to a Django 1.2.1 server after developing on a 1.1.1.
What changed?
I read http://code.djangoproject.com/wiki/NewformsAdminBranch#Changedprepopulate_fromtobedefinedintheAdminclassnotdatabasefieldclasses but didn't find a way to fix it, my code seems good.
Ideas? Code:
class Data(models.Model):
title = models.CharField(max_length=50)
slug = models.SlugField(max_length=50, unique=True, help_text='Unique value for product page URL, created from name.')
class DataAdmin(admin.ModelAdmin):
list_display = ('title', 'user', 'category')
list_filter = ('user', 'category')
ordering = ('title',)
search_fields = ('title',)
prepopulated_fields = {'slug': ('title',)}
admin.site.register(Data, DataAdmin)