Generated: Wed 2013-03-13 10:33 CET
Source file: /media/Envs/Envs/filer-gallery/lib/python2.7/site-packages/south/introspection_plugins/geodjango.py
Stats: 0 executed, 6 missed, 5 excluded, 34 ignored
"""GeoDjango introspection rules"""import djangofrom django.conf import settingsfrom south.modelsinspector import add_introspection_ruleshas_gis = "django.contrib.gis" in settings.INSTALLED_APPSif has_gis: # Alright,import the field from django.contrib.gis.db.models.fields import GeometryField # Make some introspection rules if django.VERSION[0] == 1 and django.VERSION[1] >= 1: # Django 1.1's gis module renamed these. rules = [ ( (GeometryField, ), [], { "srid": ["srid", {"default": 4326}], "spatial_index": ["spatial_index", {"default": True}], "dim": ["dim", {"default": 2}], "geography": ["geography", {"default": False}], }, ), ] else: rules = [ ( (GeometryField, ), [], { "srid": ["_srid", {"default": 4326}], "spatial_index": ["_index", {"default": True}], "dim": ["_dim", {"default": 2}], }, ), ] # Install them add_introspection_rules(rules, ["^django\.contrib\.gis"])