From 7622933e291141b5d58293eacb813d0c0635695f Mon Sep 17 00:00:00 2001 From: luxagraf Date: Tue, 19 Jan 2016 14:40:24 -0500 Subject: added my daily journal recording app, weather grabbing widget and checkin model. Still need to add widget to checkin admin to automatically grab the geodata from device. --- app/daily/admin.py | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 app/daily/admin.py (limited to 'app/daily/admin.py') diff --git a/app/daily/admin.py b/app/daily/admin.py new file mode 100644 index 0000000..210aabc --- /dev/null +++ b/app/daily/admin.py @@ -0,0 +1,49 @@ +from django.contrib import admin +from django import forms +from django.contrib.gis.admin import OSMGeoAdmin + +from utils.widgets import AdminImageWidget, LGEntryForm +from .models import CheckIn, Daily, Weather + + +class WeatherAdmin(OSMGeoAdmin): + pass + + +class DailyAdmin(OSMGeoAdmin): + form = LGEntryForm + fieldsets = ( + (None, { + 'fields': ( + 'title', + 'body_markdown', + 'weather_human', + ) + }), + ('Details', { + 'fields': ( + 'location', + 'weather', + 'date' + ), + 'classes': ('collapse',), + }), + ) + + +class CheckInAdmin(OSMGeoAdmin): + list_display = ('date', 'location') + default_lon = -9285175 + default_lat = 4025046 + default_zoom = 15 + units = True + scrollable = False + map_width = 700 + map_height = 425 + map_template = 'gis/admin/osm.html' + openlayers_url = '/static/admin/js/OpenLayers.js' + + +admin.site.register(CheckIn, CheckInAdmin) +admin.site.register(Weather, WeatherAdmin) +admin.site.register(Daily, DailyAdmin) -- cgit v1.2.3-70-g09d2