Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow Datalists to be sorted natively without supplying a key.

  • Loading branch information...
commit 61045e47bca155fb40ec2de47d01cd86bd28992b 1 parent 75a14b7
@wagnerrp authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 tmdb3/util.py
View
5 tmdb3/util.py
@@ -181,7 +181,10 @@ def __set__(self, inst, value):
val._locale = inst._locale
data.append(val)
if self.sort:
- data.sort(key=lambda x: getattr(x, self.sort))
+ if self.sort is True:
+ data.sort()
+ else:
+ data.sort(key=lambda x: getattr(x, self.sort))
inst._data[self.field] = data
class Datadict( Data ):
Please sign in to comment.
Something went wrong with that request. Please try again.