[Fixed]-Acessing Meta ordering from relational model in Django

1👍

From the docs for order_by

By default, results returned by a QuerySet are ordered by the ordering tuple given by the ordering option in the model’s Meta.

So you don’t need to access it at all, they use this ordering already.

If you’re looking to apply the related models ordering as part of the other model, you should be able to include it in the list of ordering

ordering = ['-date_created', 'images']
👤Sayse

Leave a comment