django 1.1 compatibility
authorjlaine <jlaine@e071eeec-0327-468d-9b6a-08194a12b294>
Fri, 14 Aug 2009 14:11:25 +0000 (14:11 +0000)
committerjlaine <jlaine@e071eeec-0327-468d-9b6a-08194a12b294>
Fri, 14 Aug 2009 14:11:25 +0000 (14:11 +0000)
git-svn-id: https://svn.bolloretelecom.eu/opensource/django-ldapdb/trunk@473 e071eeec-0327-468d-9b6a-08194a12b294

ldapdb/models/query.py

index 6eaecb117fcdb6232a0d7af33b1f796e2a310d48..e79a8bc0b6768e7040222f2e76372b959eb41802 100644 (file)
@@ -37,7 +37,12 @@ class WhereNode(BaseWhereNode):
             if isinstance(item, WhereNode):
                 bits.append(item.as_sql())
                 continue
-            table, column, type, x, y, values = item
+            if len(item) == 4:
+                # django 1.1
+                (table, column, type), x, y, values = item
+            else:
+                # django 1.0
+                table, column, type, x, y, values = item
             if self.negated:
                 bits.append('(!(%s=%s))' % (column,values[0]))
             else: