diff --git a/etiquette/searchhelpers.py b/etiquette/searchhelpers.py index 55410c2..a9b44b9 100644 --- a/etiquette/searchhelpers.py +++ b/etiquette/searchhelpers.py @@ -334,6 +334,12 @@ def normalize_orderby(orderby, warning_bag=None): if column == 'random': column = 'RANDOM()' + elif column == 'area': + column = 'width * height' + + elif column == 'ratio': + column = 'width / height' + if direction not in ('asc', 'desc'): message = constants.WARNING_ORDERBY_BADDIRECTION.format( column=column,