patient = models.ForeignKey(Patient, blank=True, null=True, on_delete=models.CASCADE)
device = models.ForeignKey(Device, on_delete=models.CASCADE)
created_date = models.DateTimeField()
front_id = models.UUIDField(blank=True, null=True)
def str(self):
return f'{self.device}'
class MeasurememtResult(models.Model):
measurement_result = models.FloatField()
measurement_type = models.CharField(choices=MEASUREMENT_TYPES, max_length=30)
device_measurement_id = models.ForeignKey(DeviceMeasurement, related_name='results', on_delete=models.CASCADE)
queryset = DeviceMeasurement.objects.values('patient__id','device__id').prefetch_related('results').all()
но вот поля с MeasurememtResult не возвращаются(
почему не select_related() ?
Обсуждают сегодня