Most likely in your database that boolean field is stored as TINYINT (or other integer type). That means number 0
will represent False and number 1
will represent True. So when you make ORM call like this:
ShopOffer.objects.filter(added_by__user_id=user).order_by('-is_active')
Your SQL query contains this part:
ORDER BY shop_owner_shopoffer.is_active DESC
What does that mean. That means descending order for integer field. So greater numbers will come first, smaller numbers will come second. So 1
values (True) will come first, 0
values will come second. So True
will come first, False
will come second.
So if you want False values come first, your query should be like:
ShopOffer.objects.filter(added_by__user_id=user).order_by('is_active')
But once again, it all depends on RDBMS you use. I suggest to check DDL code of the table for ShopOffer
table - to see the type of is_active
field.
UPDATE1
https://i.stack.imgur.com/sx1g4.png
It's MySQL
UPDATE2
OP confirmed that it's TINYINT field