[Answer]-Django order_by clause

1👍

The result of your queryset should be ordered by the attribute lok_sabbah in alphabetical order from the code you wrote here. Meanwhile, I don’t know what you’re using when ‘printing’ your model.

Could you copy/paste us your str method to be sure of the printed result?

Maybe, you just need an order_by(pk) if the names follow the order of their creation…

Leave a comment