5👍
✅
util
modules were renamed to utils
in Django 1.7 (release notes).
To update your code for Django 1.7+, replace the import
from django.contrib.admin import util
with
from django.contrib.admin import utils
Then change the code to
obj.update({
'fields': utils.flatten_fieldsets(self.add_fieldsets),
})
1👍
The import path is django.contrib.admin.utils
not django.admin.utils
so replace your import with –
from django.contrib.admin import utils
- [Django]-Django Testing: URL mapping to the Class Based View
- [Django]-How to make non-editable fields appear when creating objects in Django admin?
- [Django]-Django admin list_display with count annotation
Source:stackexchange.com