id summary reporter owner description type status component version severity resolution keywords cc stage has_patch needs_docs needs_tests needs_better_patch easy ui_ux 22018 Checks error on ModelAdmins with multiple fields in one line using lists Julian Wachholz Julian Wachholz "The checks framework will raise an error for ModelAdmin classes that use a `fields` or `fieldset` attribute containing multiple fields in one line - although only when using lists, using tuples works as expected. Example: {{{ class FooAdmin(admin.ModelAdmin): fields = ['foo', ['bar', 'baz']] admin.site.register(Foo, FooAdmin) }}} Traceback: {{{ File ""/home/jwa/projects/django17/apps/foos/admin.py"", line 15, in admin.site.register(Foo, FooAdmin) File ""/home/jwa/.venvs/django17/lib/python3.3/site-packages/django/contrib/admin/sites.py"", line 103, in register admin_class.check(model) File ""/home/jwa/.venvs/django17/lib/python3.3/site-packages/django/contrib/admin/options.py"", line 145, in check return cls.checks_class().check(cls, model, **kwargs) File ""/home/jwa/.venvs/django17/lib/python3.3/site-packages/django/contrib/admin/checks.py"", line 489, in check errors = super(ModelAdminChecks, self).check(cls, model=model, **kwargs) File ""/home/jwa/.venvs/django17/lib/python3.3/site-packages/django/contrib/admin/checks.py"", line 27, in check errors.extend(self._check_fields(cls, model)) File ""/home/jwa/.venvs/django17/lib/python3.3/site-packages/django/contrib/admin/checks.py"", line 87, in _check_fields elif len(cls.fields) != len(set(cls.fields)): TypeError: unhashable type: 'list' }}} So the `_check_fields` and `_check_fieldsets_item` checks need to take care of lists. " Bug closed contrib.admin dev Normal fixed checks Accepted 0 0 0 0 1 0