'NoneType' object has no attribute '__getitem__' Please help me to debug this

56 views
Skip to first unread message

Ham Kibz

unread,
Nov 6, 2013, 6:46:23 AM11/6/13
to django...@googlegroups.com
Below is the traceback

Django Version: 1.5.1
Python Version: 2.7.4
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.admin',
 'products')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')


Traceback:
File "/home/kelcy/django1.5.1/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  115.                         response = callback(request, *callback_args, **callback_kwargs)
File "/home/kelcy/django1.5.1/local/lib/python2.7/site-packages/django/contrib/admin/options.py" in wrapper
  372.                 return self.admin_site.admin_view(view)(*args, **kwargs)
File "/home/kelcy/django1.5.1/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  91.                     response = view_func(request, *args, **kwargs)
File "/home/kelcy/django1.5.1/local/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  89.         response = view_func(request, *args, **kwargs)
File "/home/kelcy/django1.5.1/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner
  202.             return view(request, *args, **kwargs)
File "/home/kelcy/django1.5.1/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapper
  25.             return bound_func(*args, **kwargs)
File "/home/kelcy/django1.5.1/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  91.                     response = view_func(request, *args, **kwargs)
File "/home/kelcy/django1.5.1/local/lib/python2.7/site-packages/django/utils/decorators.py" in bound_func
  21.                 return func(self, *args2, **kwargs2)
File "/home/kelcy/django1.5.1/local/lib/python2.7/site-packages/django/db/transaction.py" in inner
  223.                 return func(*args, **kwargs)
File "/home/kelcy/django1.5.1/local/lib/python2.7/site-packages/django/contrib/admin/options.py" in add_view
  1009.                 self.log_addition(request, new_object)
File "/home/kelcy/django1.5.1/local/lib/python2.7/site-packages/django/contrib/admin/options.py" in log_addition
  530.             action_flag     = ADDITION
File "/home/kelcy/django1.5.1/local/lib/python2.7/site-packages/django/contrib/admin/models.py" in log_action
  18.         e = self.model(None, None, user_id, content_type_id, smart_text(object_id), object_repr[:200], action_flag, change_message)

Exception Type: TypeError at /admin/products/catalogcategory/add/
Exception Value: 'NoneType' object has no attribute '__getitem__'

James Turley

unread,
Nov 6, 2013, 8:29:16 AM11/6/13
to django...@googlegroups.com
Hi Ham, I was following your thread on the LinkedIn django group and it looked there like you had a couple of simple typos in your CatalogCategory model's __unicode__ method. Did you get round to fixing those?

JT


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1798ea05-5f4e-4e9d-aebf-0227a840e0c8%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages