Let's say there is a model with default ordering described in Meta class
class People(models.Model):
first_name = models.CharField(max_length=100)
last_name = models.CharField(max_length=100)
middle_name = models.CharField(max_length=100)
class Meta:
ordering = (last_name, first_name)
Is there are a way to get unordered queryset
You can just override by simply adding .order_by()
for example:
People.objects.all().order_by()
This will make sure that Meta ordering is overridden.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With