south.introspection_plugins.geodjango: 11 total statements, 0.0% covered

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

  1. """
  2. GeoDjango introspection rules
  3. """
  4. import django
  5. from django.conf import settings
  6. from south.modelsinspector import add_introspection_rules
  7. has_gis = "django.contrib.gis" in settings.INSTALLED_APPS
  8. if has_gis:
  9. # Alright,import the field
  10. from django.contrib.gis.db.models.fields import GeometryField
  11. # Make some introspection rules
  12. if django.VERSION[0] == 1 and django.VERSION[1] >= 1:
  13. # Django 1.1's gis module renamed these.
  14. rules = [
  15. (
  16. (GeometryField, ),
  17. [],
  18. {
  19. "srid": ["srid", {"default": 4326}],
  20. "spatial_index": ["spatial_index", {"default": True}],
  21. "dim": ["dim", {"default": 2}],
  22. "geography": ["geography", {"default": False}],
  23. },
  24. ),
  25. ]
  26. else:
  27. rules = [
  28. (
  29. (GeometryField, ),
  30. [],
  31. {
  32. "srid": ["_srid", {"default": 4326}],
  33. "spatial_index": ["_index", {"default": True}],
  34. "dim": ["_dim", {"default": 2}],
  35. },
  36. ),
  37. ]
  38. # Install them
  39. add_introspection_rules(rules, ["^django\.contrib\.gis"])