Verified Commit 7000fad2 authored by David Haynes's avatar David Haynes 🙆
Browse files

Add GeoJson Point to Location

- (x,y) point where the Facility is located
- Pretty map added to admin interface
parent b6e769a5
......@@ -11,7 +11,7 @@ from __future__ import (absolute_import, division, print_function,
# Django Imports
from django.contrib import admin
from django.contrib.gis.admin import OSMGeoAdmin
# App Imports
from .models import Facility, Schedule, OpenTime, Category, Location, Alert
......@@ -70,7 +70,8 @@ class ScheduleAdmin(admin.ModelAdmin):
# https://docs.djangoproject.com/en/1.11/ref/contrib/admin/#modeladmin-objects
admin.site.register(Facility, FacilityAdmin)
admin.site.register(Schedule, ScheduleAdmin)
# https://docs.djangoproject.com/en/1.11/ref/contrib/gis/admin/#osmgeoadmin
admin.site.register(Location, OSMGeoAdmin)
# Use the default ModelAdmin interface for these
admin.site.register(Category)
admin.site.register(Location)
admin.site.register(Alert)
......@@ -15,6 +15,7 @@ import datetime
# Django Imports
from django.db import models
from django.contrib.gis.db.models import PointField
from django.contrib.auth.models import User
from django.core.validators import RegexValidator
......@@ -58,6 +59,8 @@ class Location(TimeStampedModel):
address = models.CharField(max_length=100)
# Boolean for whether or not the location is "on campus" or not.
on_campus = models.BooleanField(default=True)
# A GeoJson coordinate pair that represents the physical location
coordinate_location = PointField()
class Meta:
verbose_name = "location"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment