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

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 s

how to write routers for the modelviewset based view function

2018-10-06 Thread Jun Ren
Hello, I defined a model as following, and writ a view based on the ModelViewset, also overidden the get_query function, as folloing: class MachineStatus(models.Model): Soft_ID = models.CharField(max_length=20) operator_jun = models.CharField(max_length=20) end_date = models.Date