django-ecommerce-project
django-ecommerce-project copied to clipboard
ERRORS: <class 'store.admin.CategoryAdmin'>: (admin.E029) The value of 'prepopulated_fields["slug"]' must be a list or tuple.
Hi,
Tried to create super user python manage.py createsuperuser
and got the following error:
ERRORS:
<class 'store.admin.CategoryAdmin'>: (admin.E029) The value of 'prepopulated_fields["slug"]' must be a list or tuple.
<class 'store.admin.ProductAdmin'>: (admin.E029) The value of 'prepopulated_fields["slug"]' must be a list or tuple.
Here is a fix:
prepopulated_fields = {'slug': ('name,')}
prepopulated_fields = {'slug': ['name']}
prepopulated_fields = {'slug': ('title,')}
prepopulated_fields = {'slug': ['title']}
For an explanation on why you must use either a list or tuple, see Django Admin Documentation:
ModelAdmin.prepopulated_fields
😄