ordering by a field that does not exists returns an empty QuerySet
|Reported by:||Rob Hudson||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||1.2|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||yes|
.order_by('field_that_does_not_exist') and evaluate it you get an empty list. This can lead to bugs if you mistype the field name and wondering why you are getting no results. I would expect Django to raise an exception instead. It appears it the queryset doesn't even trigger a database call.