From: jlaine Date: Sun, 6 Sep 2009 08:41:36 +0000 (+0000) Subject: fix results ordering when a key is not present X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=d83dc5004cd660c3aa43a56550c5e527524b5bde;p=matthijs%2Fupstream%2Fdjango-ldapdb.git fix results ordering when a key is not present git-svn-id: https://svn.bolloretelecom.eu/opensource/django-ldapdb/trunk@646 e071eeec-0327-468d-9b6a-08194a12b294 --- diff --git a/ldapdb/models/query.py b/ldapdb/models/query.py index 7d952d4..902d237 100644 --- a/ldapdb/models/query.py +++ b/ldapdb/models/query.py @@ -85,7 +85,7 @@ class Query(BaseQuery): keys = [] for k in ordering: attr = self.model._meta.get_field(k).db_column - keys.append(x[1][attr]) + keys.append(x[1].get(attr, None)) return keys vals = sorted(vals, key=lambda x: getkey(x))