From 3912bd6478e2c17a4ea171840a50d1d78ca2694c Mon Sep 17 00:00:00 2001 From: jlaine Date: Mon, 24 May 2010 09:35:02 +0000 Subject: [PATCH] fix QuerySet constructor for django 1.2 git-svn-id: https://svn.bolloretelecom.eu/opensource/django-ldapdb/trunk@868 e071eeec-0327-468d-9b6a-08194a12b294 --- ldapdb/models/query.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ldapdb/models/query.py b/ldapdb/models/query.py index 738124f..020d4ee 100644 --- a/ldapdb/models/query.py +++ b/ldapdb/models/query.py @@ -158,8 +158,15 @@ class Query(BaseQuery): yield row class QuerySet(BaseQuerySet): - def __init__(self, model=None, query=None): + def __init__(self, model=None, query=None, using=None): if not query: - query = Query(model, None, WhereNode) + import inspect + spec = inspect.getargspec(Query.__init__) + if len(spec[0]) == 3: + # django 1.2 + query = Query(model, WhereNode) + else: + # django 1.1 + query = Query(model, None, WhereNode) super(QuerySet, self).__init__(model, query) -- 2.30.2