这可能有解释吗? 查询集应该为空,但len()返回1个对象。但是当我尝试访问该对象时,它不存在。之前从未见过。
(Pdb) self.service_ride_windows_set.all()
*** RelatedObjectDoesNotExist: RideWindow has no ride.
(Pdb) self.service_ride_windows_set.all().exists()
True
(Pdb) len(self.service_ride_windows_set.all())
1
(Pdb) self.service_ride_windows_set.all()[0]
*** RelatedObjectDoesNotExist: RideWindow has no ride.
(Pdb) self.service_ride_windows_set.get()
*** RelatedObjectDoesNotExist: RideWindow has no ride.
(Pdb)