Django ignore request model order parameter

In my model I have

class Meta:
    ordering = ['title']

Is there a way that I can leave it in the definition of the model as useful elsewhere, but in the request to say that it ignores it without having order?

+3
source share
1 answer

The documentation is your friend: http://docs.djangoproject.com/en/dev/ref/models/querysets/#order-by-fields

New in Django 1.0: Please, see the release notes

If you don't want any ordering to be applied to a query, 
not even the default ordering,  call order_by() with no parameters.
+3
source

Source: https://habr.com/ru/post/1760710/


All Articles