Dict objects are unhashable errors

236 views
Skip to first unread message

Some Guy

unread,
Jul 15, 2009, 3:12:15 PM7/15/09
to Django users
Hi,
I seem to have a problem where various contrib elements are throwing a
template error "dict objects are unhashable"
I'm seeing it in admin, comments, etc. Both on my dev setup and
deployed.

The line of code always seems to be File "/Library/Python/2.5/site-
packages/django/utils/datastructures.py", line 269, in setlistdefault
if key not in self:

How am I the only one experiencing this? :-)

Dev: devserver, Python 2.5.1 (r251:54863, Feb 6 2009, 19:02:12),
sqlite3

Deployed: apache2/modpython, Python 2.5.2 (r252:60911, Jul 31 2008,
17:31:22), sqlite3

any Ideas?

Some Guy

unread,
Jul 15, 2009, 3:14:20 PM7/15/09
to Django users
I should add my django versions too

dev: 1.1 beta 1 SVN-11082

Deploy: 1.1 beta 1

Some Guy

unread,
Jul 16, 2009, 5:07:31 PM7/16/09
to Django users
Found out what was causing this error behavior.

this line was in my urls.py.. commenting it out fixed everything. I
just can't see what's wrong with it :-)

# (r'^diamond/(?P<object_id>\d+)/$', 'object_detail', info_dict,
{'template': 'diamond_detail.html'}),

Alex Koshelev

unread,
Jul 16, 2009, 5:15:03 PM7/16/09
to django...@googlegroups.com
On Fri, Jul 17, 2009 at 1:07 AM, Some Guy <dju...@gmail.com> wrote:

Found out what was causing this error behavior.

this line was in my urls.py.. commenting it out fixed everything.  I
just can't see what's wrong with it :-)

#    (r'^diamond/(?P<object_id>\d+)/$', 'object_detail', info_dict,
{'template': 'diamond_detail.html'}),

Please read url patterns docs [1] and answer to yourself - why you have 2 dicts in one pattern?

[1]: http://docs.djangoproject.com/en/dev/topics/http/urls/#patterns
 
---
Alex Koshelev

Some Guy

unread,
Jul 16, 2009, 6:36:14 PM7/16/09
to Django users
good question! I was basing it off the docs (or so I thought) on
generic views.
django urls.py has never been very intuitive for me, so I rely on
copying from the docs pretty heavily. I guess it got mangled at some
stage... thanks for the link tho.

:)

On Jul 16, 2:15 pm, Alex Koshelev <daeva...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages