Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

.MultipleObjectsReturned: get() returned more than one

If you want only one answer instead of multipe:

You need to use .filter() method
e.g Model.objects.filter(fname=first_name)
Now you may perform more filters like Model.objects.filter(fname=first_name).first() if you want only first
record or others as required.
 
PREVIOUS NEXT
Tagged: #returned
ADD COMMENT
Topic
Name
3+7 =