Changeset 8155 for django/branches/gis/django/contrib/gis/models.py
- Timestamp:
- 07/30/08 12:46:02 (4 months ago)
- Files:
-
- django/branches/gis/django/contrib/gis/models.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/gis/django/contrib/gis/models.py
r7666 r8155 212 212 _srid_info = True 213 213 if settings.DATABASE_ENGINE == 'postgresql_psycopg2': 214 from django.contrib.gis.db.backend.postgis.models import GeometryColumns, SpatialRefSys 214 # Because the PostGIS version is checked when initializing the spatial 215 # backend a `ProgrammingError` will be raised if the PostGIS tables 216 # and functions are not installed. We catch here so it won't be raised when 217 # running the Django test suite. 218 from psycopg2 import ProgrammingError 219 try: 220 from django.contrib.gis.db.backend.postgis.models import GeometryColumns, SpatialRefSys 221 except ProgrammingError: 222 _srid_info = False 215 223 elif settings.DATABASE_ENGINE == 'oracle': 216 from django.contrib.gis.db.backend.oracle.models import GeometryColumns, SpatialRefSys 224 # Same thing as above, except the GEOS library is attempted to be loaded for 225 # `BaseSpatialBackend`, and an exception will be raised during the 226 # Django test suite if it doesn't exist. 227 try: 228 from django.contrib.gis.db.backend.oracle.models import GeometryColumns, SpatialRefSys 229 except: 230 _srid_info = False 217 231 else: 218 232 _srid_info = False
