summaryrefslogtreecommitdiff
path: root/apps/locations/admin.py
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2012-09-22 22:27:04 -0400
committerluxagraf <sng@luxagraf.net>2012-09-22 22:27:04 -0400
commitefb623af0bcb47d510501c282e1326b11343a29c (patch)
tree3a35fb19f5eba3b219c65277a5fb712cbe9604ac /apps/locations/admin.py
parent0b481fd7931c2ae20ca21f89a87f2ba6a6c01e10 (diff)
site reorg
Diffstat (limited to 'apps/locations/admin.py')
-rw-r--r--apps/locations/admin.py295
1 files changed, 0 insertions, 295 deletions
diff --git a/apps/locations/admin.py b/apps/locations/admin.py
deleted file mode 100644
index a23ef28..0000000
--- a/apps/locations/admin.py
+++ /dev/null
@@ -1,295 +0,0 @@
-from django.contrib import admin
-from django.contrib.gis.admin import OSMGeoAdmin
-from locations.models import Region,Country,Location,State,Route
-from django.contrib import databrowse
-from django.contrib.gis.maps.google import GoogleMap
-from django.conf import settings
-
-GMAP = GoogleMap(key=settings.GOOGLE_MAPS_API_KEY)
-databrowse.site.register(Region)
-
-class RegionAdmin(OSMGeoAdmin):
- # Standard Django Admin Options
- list_display = ('name','slug')
- prepopulated_fields = {'slug': ('name',)}
- search_fields = ('name',)
- ordering = ('name',)
- save_as = True
- search_fields = ['name',]
- list_select_related = True
- fieldsets = (
- ('Region', {'fields': ('name','slug','pub_date'), 'classes': ('show','extrapretty')}),
- ('Editable Map View', {'fields': ('geometry',), 'classes': ('show', 'wide')}),
- )
- extra_js = [GMAP.api_url + GMAP.key]
- map_template = 'gis/admin/google.html'
- # Default GeoDjango OpenLayers map options
- # Uncomment and modify as desired
- # To learn more about this jargon visit:
- # www.openlayers.org
-
- #default_lon = 0
- #default_lat = 0
- #default_zoom = 4
- #display_wkt = False
- #display_srid = False
- #extra_js = []
- #num_zoom = 18
- #max_zoom = False
- #min_zoom = False
- #units = False
- #max_resolution = False
- #max_extent = False
- #modifiable = True
- #mouse_position = True
- #scale_text = True
- #layerswitcher = True
- scrollable = False
- #admin_media_prefix = settings.ADMIN_MEDIA_PREFIX
- map_width = 700
- map_height = 325
- #map_srid = 4326
- #map_template = 'gis/admin/openlayers.html'
- #openlayers_url = 'http://openlayers.org/api/2.6/OpenLayers.js'
- #wms_url = 'http://labs.metacarta.com/wms/vmap0'
- #wms_layer = 'basic'
- #wms_name = 'OpenLayers WMS'
- #debug = False
- #widget = OpenLayersWidget
-
-# Finally, with these options set now register the model
-# associating the Options with the actual model
-admin.site.register(Region,RegionAdmin)
-
-class CountryAdmin(OSMGeoAdmin):
- """
- # Standard Django Admin Options
- list_display = ('name','slug','region')
- prepopulated_fields = {'slug': ('name',)}
- search_fields = ('name',)
- ordering = ('name',)
- save_as = True
- search_fields = ['name',]
- list_select_related = True
- fieldsets = (
- ('Country', {'fields': ('name','slug','abbr','region','pub_date'), 'classes': ('show','extrapretty')}),
- ('Editable Map View', {'fields': ('geometry',), 'classes': ('show', 'wide')}),
- )
- """
-
- # Standard Django Admin Options
- list_display = ('name','pop2005','region','subregion',)
- search_fields = ('name',)
- ordering = ('name',)
- list_filter = ('visited','region','subregion',)
- save_as = True
- search_fields = ['name','iso2','iso3','subregion','region']
- list_select_related = True
- fieldsets = (
- ('Country Attributes', {'fields': (('name','pop2005','slug','zoom_level','visited')), 'classes': ('show','extrapretty')}),
- ('Country Codes', {'fields': ('region','subregion','iso2','iso3','un',), 'classes': ('collapse',)}),
- ('Area and Coordinates', {'fields': ('area','lat','lon',), 'classes': ('collapse', 'wide')}),
- ('Editable Map View', {'fields': ('geometry',), 'classes': ('show', 'wide')}),
- )
-
- extra_js = [GMAP.api_url + GMAP.key]
- map_template = 'gis/admin/google.html'
- # Default GeoDjango OpenLayers map options
- # Uncomment and modify as desired
- # To learn more about this jargon visit:
- # www.openlayers.org
-
- #default_lon = 0
- #default_lat = 0
- #default_zoom = 4
- #display_wkt = False
- #display_srid = False
- #extra_js = []
- #num_zoom = 18
- #max_zoom = False
- #min_zoom = False
- #units = False
- #max_resolution = False
- #max_extent = False
- #modifiable = True
- #mouse_position = True
- #scale_text = True
- #layerswitcher = True
- scrollable = False
- #admin_media_prefix = settings.ADMIN_MEDIA_PREFIX
- map_width = 700
- map_height = 325
- #map_srid = 4326
- #map_template = 'gis/admin/openlayers.html'
- #openlayers_url = 'http://openlayers.org/api/2.6/OpenLayers.js'
- #wms_url = 'http://labs.metacarta.com/wms/vmap0'
- #wms_layer = 'basic'
- #wms_name = 'OpenLayers WMS'
- #debug = False
- #widget = OpenLayersWidget
-
-# Finally, with these options set now register the model
-# associating the Options with the actual model
-admin.site.register(Country,CountryAdmin)
-
-
-
-class StateAdmin(OSMGeoAdmin):
- # Standard Django Admin Options
- list_display = ('name','code','slug','country')
- prepopulated_fields = {'slug': ('name',)}
- search_fields = ('name','country')
- ordering = ('name',)
- save_as = True
- search_fields = ['name',]
- list_select_related = True
- fieldsets = (
- ('Location', {'fields': ('name','slug','code','pub_date','country'), 'classes': ('show','extrapretty')}),
- ('Editable Map View', {'fields': ('geometry',), 'classes': ('show', 'wide')}),
- )
- extra_js = [GMAP.api_url + GMAP.key]
- map_template = 'gis/admin/google.html'
- # Default GeoDjango OpenLayers map options
- # Uncomment and modify as desired
- # To learn more about this jargon visit:
- # www.openlayers.org
-
- #default_lon = 0
- #default_lat = 0
- #default_zoom = 4
- #display_wkt = False
- #display_srid = False
- #extra_js = []
- #num_zoom = 18
- #max_zoom = False
- #min_zoom = False
- #units = False
- #max_resolution = False
- #max_extent = False
- #modifiable = True
- #mouse_position = True
- #scale_text = True
- #layerswitcher = True
- scrollable = False
- #admin_media_prefix = settings.ADMIN_MEDIA_PREFIX
- map_width = 700
- map_height = 325
- #map_srid = 4326
- #map_template = 'gis/admin/openlayers.html'
- #openlayers_url = 'http://openlayers.org/api/2.6/OpenLayers.js'
- #wms_url = 'http://labs.metacarta.com/wms/vmap0'
- #wms_layer = 'basic'
- #wms_name = 'OpenLayers WMS'
- #debug = False
- #widget = OpenLayersWidget
-
-# Finally, with these options set now register the model
-# associating the Options with the actual model
-admin.site.register(State,StateAdmin)
-
-class LocationAdmin(OSMGeoAdmin):
- # Standard Django Admin Options
- list_display = ('name','slug','state')
- prepopulated_fields = {'slug': ('name',)}
- search_fields = ('name','state')
- ordering = ('name',)
- save_as = True
- search_fields = ['name',]
- list_select_related = True
- fieldsets = (
- ('Location', {'fields': ('name','slug','pub_date','state'), 'classes': ('show','extrapretty')}),
- ('Editable Map View', {'fields': ('geometry',), 'classes': ('show', 'wide')}),
- )
- extra_js = [GMAP.api_url + GMAP.key]
- map_template = 'gis/admin/google.html'
- # Default GeoDjango OpenLayers map options
- # Uncomment and modify as desired
- # To learn more about this jargon visit:
- # www.openlayers.org
-
- #default_lon = 0
- #default_lat = 0
- #default_zoom = 4
- #display_wkt = False
- #display_srid = False
- #extra_js = []
- #num_zoom = 18
- #max_zoom = False
- #min_zoom = False
- #units = False
- #max_resolution = False
- #max_extent = False
- #modifiable = True
- #mouse_position = True
- #scale_text = True
- #layerswitcher = True
- scrollable = False
- #admin_media_prefix = settings.ADMIN_MEDIA_PREFIX
- map_width = 700
- map_height = 325
- #map_srid = 4326
- #map_template = 'gis/admin/openlayers.html'
- #openlayers_url = 'http://openlayers.org/api/2.6/OpenLayers.js'
- #wms_url = 'http://labs.metacarta.com/wms/vmap0'
- #wms_layer = 'basic'
- #wms_name = 'OpenLayers WMS'
- #debug = False
- #widget = OpenLayersWidget
-
-# Finally, with these options set now register the model
-# associating the Options with the actual model
-admin.site.register(Location,LocationAdmin)
-
-class RouteAdmin(OSMGeoAdmin):
- # Standard Django Admin Options
- list_display = ('name','slug',)
- prepopulated_fields = {'slug': ('name',)}
- search_fields = ('name',)
- ordering = ('name',)
- save_as = True
- search_fields = ['name',]
- list_select_related = True
- fieldsets = (
- ('Location', {'fields': ('name','slug','pub_date','template_var_name','zoom'), 'classes': ('show','extrapretty')}),
- ('Editable Map View', {'fields': ('geometry',), 'classes': ('show', 'wide')}),
- )
- extra_js = [GMAP.api_url + GMAP.key]
- map_template = 'gis/admin/google.html'
- # Default GeoDjango OpenLayers map options
- # Uncomment and modify as desired
- # To learn more about this jargon visit:
- # www.openlayers.org
-
- #default_lon = 0
- #default_lat = 0
- #default_zoom = 4
- #display_wkt = False
- #display_srid = False
- #extra_js = []
- #num_zoom = 18
- #max_zoom = False
- #min_zoom = False
- #units = False
- #max_resolution = False
- #max_extent = False
- #modifiable = True
- #mouse_position = True
- #scale_text = True
- #layerswitcher = True
- scrollable = False
- #admin_media_prefix = settings.ADMIN_MEDIA_PREFIX
- map_width = 700
- map_height = 325
- #map_srid = 4326
- #map_template = 'gis/admin/openlayers.html'
- #openlayers_url = 'http://openlayers.org/api/2.6/OpenLayers.js'
- #wms_url = 'http://labs.metacarta.com/wms/vmap0'
- #wms_layer = 'basic'
- #wms_name = 'OpenLayers WMS'
- #debug = False
- #widget = OpenLayersWidget
-
-# Finally, with these options set now register the model
-# associating the Options with the actual model
-admin.site.register(Route,RouteAdmin)
-