Answer the question
In order to leave comments, you need to log in
How to get the last entry for an ID range in Django?
This way does not work
patients_id = [1, 2, 5, 3, 9]
return Operation.objects.last(patient__in=patients_id)
Answer the question
In order to leave comments, you need to log in
Operation.object.filter(patient_id__in=patients_id).order_by('id').last()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question