__init__.py 786 B

123456789101112131415161718192021
  1. # Getting the normal admin routines, classes, and `site` instance.
  2. from django.contrib.admin import ( # NOQA: flake8 detects only the last __all__
  3. autodiscover, site, AdminSite, ModelAdmin, StackedInline, TabularInline,
  4. HORIZONTAL, VERTICAL,
  5. )
  6. # Geographic admin options classes and widgets.
  7. from django.contrib.gis.admin.options import GeoModelAdmin # NOQA
  8. from django.contrib.gis.admin.widgets import OpenLayersWidget # NOQA
  9. __all__ = [
  10. "autodiscover", "site", "AdminSite", "ModelAdmin", "StackedInline",
  11. "TabularInline", "HORIZONTAL", "VERTICAL",
  12. "GeoModelAdmin", "OpenLayersWidget", "HAS_OSM",
  13. ]
  14. try:
  15. from django.contrib.gis.admin.options import OSMGeoAdmin
  16. HAS_OSM = True
  17. __all__ += ['OSMGeoAdmin']
  18. except ImportError:
  19. HAS_OSM = False