fix results ordering when a key is not present
authorjlaine <jlaine@e071eeec-0327-468d-9b6a-08194a12b294>
Sun, 6 Sep 2009 08:41:36 +0000 (08:41 +0000)
committerjlaine <jlaine@e071eeec-0327-468d-9b6a-08194a12b294>
Sun, 6 Sep 2009 08:41:36 +0000 (08:41 +0000)
git-svn-id: https://svn.bolloretelecom.eu/opensource/django-ldapdb/trunk@646 e071eeec-0327-468d-9b6a-08194a12b294

ldapdb/models/query.py

index 7d952d45b23aca76514f787f7c22e87d9498345d..902d23713566abaed295050faa9b8aa22ac238f2 100644 (file)
@@ -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))