Skip to content

Commit

Permalink
use Aakashs's suggestion - sort queryset by created_date descending
Browse files Browse the repository at this point in the history
Co-authored-by: Aakash Singh <mail@singhaakash.dev>
  • Loading branch information
Omkar76 and sainak committed Feb 22, 2024
1 parent f7afc53 commit 2105baa
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Migration(migrations.Migration):
def fill_previous_consultation(apps, schema_editor):
PatientConsultation = apps.get_model("facility", "PatientConsultation")
bulk_update_list = []
qs = PatientConsultation.objects.all()
qs = PatientConsultation.objects.all().order_by("-created_date")

def get_previous_consultation(consultation):
previous_consultation = qs.filter(
Expand Down

0 comments on commit 2105baa

Please sign in to comment.