Hi,

Today I got this in mail:
  File "/home/amitu/django_projects
/amitucom/apps/blogger/js_views.py", line 57, in jsma
   blog = get_object_or_404(blogs, pk=blog_id)

 File "/home/amitu/django_src/django/core/extensions.py", line 39, in get_object_or_404
   return mod.get_object(**kwargs)

 File "/home/amitu/django_src/django/utils/functional.py", line 3, in _curried
   return args[0](*(args[1:]+moreargs), **dict(kwargs.items() + morekwargs.items()))

 File "/home/amitu/django_src/django/core/meta/__init__.py", line 1358, in function_get_object
   assert len(obj_list) == 1, "get_object() returned more than one %s -- it returned %s! Lookup parameters were %s" % (opts.object_name, len(obj_list), kwargs)

AssertionError: get_object() returned more than one Blog -- it returned 2! Lookup parameters were {'pk': '3'}
How can I get more than one Blog when I am specifying pk. This happens just once, while that page is accessed more than hundreads of times everyday, I am getting a clean output when I do it on python prompt:
>>> from django.models.blogger import *
>>> blogs.get_object(pk=3)
Anything Else @ http://nerdierthanthou.nfshost.com/
Can anyone tell me the possible reason for the same? I am completely baffled.

Thanks,
--
Amit Upadhyay
Blog: http://www.rootshell.be/~upadhyay
+91-9867-359-701

Reply via email to