On Jul 20, 11:13 am, Viktor <viktor.n...@gmail.com> wrote:
> my view calls
>
> survey = get_object_or_404(models.Survey, {'pk': int(survey_id)})
>
> and gives a ValueError: need more than 1 value to unpack, the full
> traceback is athttp://python.pastebin.com/m3f715909
>
> I have no clue what the problem might be, especially as I've seen that
> in the debug views I've seen that is already has the to be returned
> survey instance. Could someone help me please. :)
>

get_object_or_404 takes (in addition to the model) the same syntax as
the normal get or filter calls. So you can't just pass a dictionary of
parameters. Try:
survey = get_object_or_404(models.Survey, pk=int(survey_id))
or, if you must use a dictionary:
survey = get_object_or_404(models.Survey, **{'pk': int(survey_id)})
to convert the dict into kwargs.
--
DR.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to