note matching query does not exist.

22 views
Skip to first unread message

Gear Crew

unread,
Sep 12, 2018, 2:37:33 PM9/12/18
to Django users

what's the problem I sure no any error in code

Screenshot from 2018-09-12 19-41-23.png

Screenshot from 2018-09-12 19-41-32.png


Manuel Alejandro Garrido Gongora

unread,
Sep 13, 2018, 8:08:10 AM9/13/18
to django...@googlegroups.com
It is likely because you are getting a directly on an object that probably does not exist in the database, I recommend that you use it instead of get filter (). first () or the method get_object_or_404 from django Regards

Enviado desde mi iPhone

El 12 sept 2018, a las 19:43, Gear Crew <mohamed.k...@gmail.com> escribió:

what's the problem I sure no any error in code

<Screenshot from 2018-09-12 19-41-23.png>

<Screenshot from 2018-09-12 19-41-32.png>


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0de12f97-7541-4aba-a280-adae62dd7c5a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<Screenshot from 2018-09-12 19-41-23.png>
<Screenshot from 2018-09-12 19-41-32.png>

Yash Thakkar

unread,
Sep 13, 2018, 8:12:53 AM9/13/18
to django...@googlegroups.com
I’m agree with you that you should use filter(). Or you can use objectname.DoesNotExist as an exception.

Reply all
Reply to author
Forward
0 new messages