Re: how to write routers for the modelviewset based view function

2018-10-07 Thread Jun Ren
I solved it , thanks your reply.

On Mon, Oct 8, 2018 at 1:36 AM Jason  wrote:

> Are you sure you have a record in the db with machine_code = 60?
>
> your model defines that field as a CharField, so using an integer in the
> URL makes me suspect you're using a primary key, which is very different
> from the definition of get_queryset
>
> --
> 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-framework+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: how to write routers for the modelviewset based view function

2018-10-07 Thread Jason
Are you sure you have a record in the db with machine_code = 60?

your model defines that field as a CharField, so using an integer in the 
URL makes me suspect you're using a primary key, which is very different 
from the definition of get_queryset 

-- 
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-framework+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.