Dec 28
'unicode' object has no attribute 'get_sql'
Another tiny snippet for you.
You fire up your Django app, only to be confronted with:
AttributeError at /highwire/projects/1/tasks/add/
'unicode' object has no attribute 'get_sql'
You've probably got a line like this:
foo = get_object_or_404(Foo, foo_id)
get_object_or_404() actually requires key/value pairs after the first class argument, in the same way the .filter() method does.
The code above should actually read:
foo = get_object_or_404(Foo, pk=foo_id)
It's the simple things that eat the most time.
I've disabled comments for now due to spam problems - I'll turn them back on when I've fixed it!