From 4ab21fbf40f456fc3126e935505af47366c64372 Mon Sep 17 00:00:00 2001 From: Justin Bronn Date: Tue, 29 Dec 2009 09:57:37 +0000 Subject: [PATCH] Fixed `GeoManager.get_query_set` incompatibility with `db_manager` method. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12021 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/gis/db/models/manager.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/django/contrib/gis/db/models/manager.py b/django/contrib/gis/db/models/manager.py index b39d652d0d..041bc0dcd5 100644 --- a/django/contrib/gis/db/models/manager.py +++ b/django/contrib/gis/db/models/manager.py @@ -10,7 +10,10 @@ class GeoManager(Manager): use_for_related_fields = True def get_query_set(self): - return GeoQuerySet(model=self.model) + qs = GeoQuerySet(self.model) + if self._db is not None: + qs = qs.using(self._db) + return qs def area(self, *args, **kwargs): return self.get_query_set().area(*args, **kwargs)