Skip to content

Commit

Permalink
Attempt django like order by only when all criterion are strings
Browse files Browse the repository at this point in the history
  • Loading branch information
shosca committed Mar 20, 2021
1 parent 65e5a59 commit 4d9b3ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion django_sorcery/db/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ def order_by(self, *criterion):
MyModel.objects.order_by("-id")
MyModel.objects.order_by("name")
"""
model = self._only_full_mapper_zero("get")
if all(isinstance(criteria, str) for criteria in criterion):
model = self._only_full_mapper_zero("get")
info = meta.model_info(model)
new_criterion = []
for criteria in criterion:
Expand Down

0 comments on commit 4d9b3ec

Please sign in to comment.