Changes between Initial Version and Version 1 of Ticket #35309, comment 5
- Timestamp:
- Mar 16, 2024, 12:35:31 AM (8 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #35309, comment 5
initial v1 1 1 I spent my night on it but I was able to make a patch, and I don't think there will be any regression. 2 2 Consider the following models in some project TestNoOrderByForForeignKeyPrefetches and some app test_no_order_by models.py file: 3 4 {{{#!python 5 from django.db import models 6 7 class A(models.Model): 8 name = models.CharField(max_length=200) 9 10 class Meta: 11 ordering = ["name"] 12 13 14 class B(models.Model): 15 name = models.CharField(max_length=200) 16 a = models.ForeignKey(A, related_name="bs", on_delete=models.CASCADE) 17 18 class Meta: 19 ordering = ["name"] 20 21 }}} 22 23 Then consider the following command TestNoOrderByForForeignKeyPrefetches/test_no_order_by/management/commands/test_no_order_by_command.py : 3 24 4 25 {{{#!python