query param detail route django rest returns 500

23 views
Skip to first unread message

sa...@magicboxasia.com

unread,
Feb 16, 2018, 9:38:58 AM2/16/18
to Django REST framework
Hi
I am fully understand the usage of the Django REST. Then I would like to discuss the mechanic of it in here since. Github template mentions me that.
First picture is `detail route`
Second picture is `list route + filter`
Third one is `error`

Today my colleague he tries add `query_param` to the `detail route` which I have never tried.
He found that Django REST returns him `500`

Why `detail route` still read the `query_param`?
Thanks
Sarit
Screen Shot 2018-02-16 at 21.32.39.png
Screen Shot 2018-02-16 at 21.33.45.png
Screen Shot 2018-02-16 at 21.36.29.png

Xavier Ordoquy

unread,
Feb 16, 2018, 9:56:28 AM2/16/18
to django-res...@googlegroups.com
It looks like you are using `query_param` to filter your dataset. The detail_route is based on the filtered dataset. However, there’s no reason the get_object returns more than one item. Maybe the project overrides the get_object in a way that breaks.

Regards,
Xavier Ordoquy,
Linovia.

--
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-fram...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<Screen Shot 2018-02-16 at 21.32.39.png><Screen Shot 2018-02-16 at 21.33.45.png><Screen Shot 2018-02-16 at 21.36.29.png>

sa...@magicboxasia.com

unread,
Feb 16, 2018, 10:36:24 AM2/16/18
to Django REST framework
Reply all
Reply to author
Forward
0 new messages