1👍
✅
Shouldn’t it just be:
ordering = ['-date_joined']
You can order by any field the model gives you.
Since you didn’t specify the UserModel you are using, I guess you are talking about the BaseUser?
If so, you can order by:
- first_name
- last_name
- id
- date_joined
- username
- [is_staff] # bool
- [is_active] # bool
Source:stackexchange.com