Commits

Anonymous committed 10807a0

[soc2009/multidb] `LayerMapping` and geographic sitemap views weren't using `DEFAULT_DB_ALIAS` as the default for `using` kwarg.

Comments (0)

Files changed (2)

django/contrib/gis/sitemaps/views.py

     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.
 
         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.
     """

django/contrib/gis/utils/layermapping.py

     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