I can\'t figure out what I\'m doing wrong here. My error is: ImproperlyConfigured at /admin/ \'CategoryAdmin.fields\' must be a list or tuple.
Isn\'
It should be:
fields = ('title', )
Example:
In [64]: type(('title'))
Out[64]: str
In [65]: type(('title', ))
Out[65]: tuple
You need a comma after title:
fields = ('title',)
No, it is not. You need to add a comma:
fields = ('title',)
It is the comma that makes this a tuple. The parenthesis are really just optional here:
>>> ('title')
'title'
>>> 'title',
('title',)
The parenthesis are of course still a good idea, with parenthesis tuples are easier to spot visually, and the parenthesis distinguish the tuple in a function call from other parameters (foo(('title',), 'bar')
is different from foo('title', 'bar')
).
Replace it with this:
fields = ('title', )