Skip to content

Commit

Permalink
Fix using aggregated subqueries in order by section
Browse files Browse the repository at this point in the history
  • Loading branch information
kozlovsky committed Jun 1, 2020
1 parent ed37926 commit 2f635b6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pony/orm/sqltranslation.py
Original file line number Diff line number Diff line change
Expand Up @@ -910,8 +910,9 @@ def apply_lambda(translator, func_id, filter_num, order_by, func_ast, argnames,
translator.inside_order_by = True
new_order = []
for node in nodes:
if isinstance(node.monad, SetMixin):
t = node.monad.type.item_type
monad = node.monad.to_single_cell_value()
if isinstance(monad, SetMixin):
t = monad.type.item_type
if isinstance(type(t), type): t = t.__name__
throw(TranslationError, 'Set of %s (%s) cannot be used for ordering'
% (t, ast2src(node)))
Expand Down

0 comments on commit 2f635b6

Please sign in to comment.