Ticket #17278: 17278-1.diff

File 17278-1.diff, 2.0 KB (added by Ramiro Morales, 13 years ago)
  • django/contrib/gis/db/backends/spatialite/base.py

    diff --git a/django/contrib/gis/db/backends/spatialite/base.py b/django/contrib/gis/db/backends/spatialite/base.py
    a b  
    5959            except Exception, msg:
    6060                raise ImproperlyConfigured('Unable to load the SpatiaLite library extension '
    6161                                           '"%s" because: %s' % (self.spatialite_lib, msg))
     62
     63            # Populate and check spatial stack components versions
     64            self.ops.confirm_spatial_components_versions()
     65
    6266            return cur
    6367        else:
    6468            return self.connection.cursor(factory=SQLiteCursorWrapper)
  • django/contrib/gis/db/backends/spatialite/operations.py

    diff --git a/django/contrib/gis/db/backends/spatialite/operations.py b/django/contrib/gis/db/backends/spatialite/operations.py
    a b  
    112112    def __init__(self, connection):
    113113        super(DatabaseOperations, self).__init__(connection)
    114114
     115        # Creating the GIS terms dictionary.
     116        gis_terms = ['isnull']
     117        gis_terms += self.geometry_functions.keys()
     118        self.gis_terms = dict([(term, None) for term in gis_terms])
     119
     120    def confirm_spatial_components_versions(self):
    115121        # Determine the version of the SpatiaLite library.
    116122        try:
    117123            vtup = self.spatialite_version_tuple()
     
    128134                                       'SQL loaded on this database?' %
    129135                                       (self.connection.settings_dict['NAME'], msg))
    130136
    131         # Creating the GIS terms dictionary.
    132         gis_terms = ['isnull']
    133         gis_terms += self.geometry_functions.keys()
    134         self.gis_terms = dict([(term, None) for term in gis_terms])
    135 
    136137        if version >= (2, 4, 0):
    137138            # Spatialite 2.4.0-RC4 added AsGML and AsKML, however both
    138139            # RC2 (shipped in popular Debian/Ubuntu packages) and RC4
Back to Top