问题描述:

There is a class in my models, and it has BooleanField.

I

want to make a sorting in which objects with BooleanField=True is shown first.

Is there a something for doing this in Django? I was searching through documentation but had no success.

网友答案:

Try:

Foo.objects.all().order_by('-field')

Like for any other field type.

相关阅读:
Top