from django.contrib import admin from django import forms from django.contrib.gis.admin import OSMGeoAdmin from django.contrib.contenttypes.admin import GenericStackedInline from utils.widgets import AdminImageWidget, LGEntryForm from .models import Camp, Trip, CampIdea from media.models import LuxImage from utils.util import get_latlon @admin.register(CampIdea) class PlannerAdmin(OSMGeoAdmin): list_display = ('name', ) #list_filter = ('has_water', ) # options for OSM map Using custom ESRI topo map lat, lon = get_latlon() default_lon = lon default_lat = lat default_zoom = 10 units = True scrollable = False map_width = 700 map_height = 425 map_template = 'gis/admin/osm.html' openlayers_url = '/static/admin/js/OpenLayers.js' class Media: js = ('image-loader.js', 'next-prev-links.js') #'product-loader.js', css = { "all": ("my_styles.css",) } @admin.register(Camp) class PlannerAdmin(OSMGeoAdmin): list_display = ('name', 'date_arrive', 'date_depart', 'distance_from_previous', 'price', 'site_number',) list_filter = ('date_arrive', 'has_water' ) # options for OSM map Using custom ESRI topo map lat, lon = get_latlon() default_lon = lon default_lat = lat default_zoom = 10 units = True scrollable = False map_width = 700 map_height = 425 map_template = 'gis/admin/osm.html' openlayers_url = '/static/admin/js/OpenLayers.js' class Media: js = ('image-loader.js', 'next-prev-links.js') #'product-loader.js', css = { "all": ("my_styles.css",) } @admin.register(Trip) class TripAdmin(OSMGeoAdmin): pass