From c3cc2198e717e84866b884f2f4370d78a9eb2b1a Mon Sep 17 00:00:00 2001 From: Justin Bronn Date: Tue, 22 Dec 2009 06:26:41 +0000 Subject: [PATCH] [soc2009/multidb] `LayerMapping` and geographic sitemap views weren't using `DEFAULT_DB_ALIAS` as the default for `using` kwarg. git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/multidb@11940 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/gis/sitemaps/views.py | 4 ++-- django/contrib/gis/utils/layermapping.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/django/contrib/gis/sitemaps/views.py b/django/contrib/gis/sitemaps/views.py index 1c8ac5c1bc82e..f3c1da24ed8cc 100644 --- a/django/contrib/gis/sitemaps/views.py +++ b/django/contrib/gis/sitemaps/views.py @@ -59,7 +59,7 @@ def sitemap(request, sitemaps, section=None): xml = smart_str(loader.render_to_string('gis/sitemaps/geo_sitemap.xml', {'urlset': urls})) return HttpResponse(xml, mimetype='application/xml') -def kml(request, label, model, field_name=None, compress=False, using=None): +def kml(request, label, model, field_name=None, compress=False, using=DEFAULT_DB_ALIAS): """ This view generates KML for the given app label, model, and field name. @@ -103,7 +103,7 @@ def kml(request, label, model, field_name=None, compress=False, using=None): render = render_to_kml return render('gis/kml/placemarks.kml', {'places' : placemarks}) -def kmz(request, label, model, field_name=None, using=None): +def kmz(request, label, model, field_name=None, using=DEFAULT_DB_ALIAS): """ This view returns KMZ for the given app label, model, and field name. """ diff --git a/django/contrib/gis/utils/layermapping.py b/django/contrib/gis/utils/layermapping.py index 41de5b49c9645..9db743aea419e 100644 --- a/django/contrib/gis/utils/layermapping.py +++ b/django/contrib/gis/utils/layermapping.py @@ -67,7 +67,7 @@ class LayerMapping(object): def __init__(self, model, data, mapping, layer=0, source_srs=None, encoding=None, transaction_mode='commit_on_success', - transform=True, unique=None, using=None): + transform=True, unique=None, using=DEFAULT_DB_ALIAS): """ A LayerMapping object is initialized using the given Model (not an instance), a DataSource (or string path to an OGR-supported data file), and a mapping