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

Add support for multiple campuses

- each Location must lie within a campus_region, or, an area that is within
the nearest vicinity to a GMU campus

Closes #55
parent d8371cc6
......@@ -53,10 +53,19 @@ class Location(TimeStampedModel):
"""
Represents a specific location that a Facility can be found.
"""
CAMPUS_LOCATIONS = (
# (set in model, human readable version)
("prince william", "Prince William County Science and Technology"),
("korea", "Mason Korea"),
("fairfax", "Fairfax"),
("arlington", "Arlington")
)
# The building that the facility is located in (on campus).
building = models.CharField(max_length=100)
# The physical address of the facility.
address = models.CharField(max_length=100)
campus_region = models.CharField(choices=CAMPUS_LOCATIONS,
max_length=100, default="fairfax")
# 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
......
......@@ -248,7 +248,8 @@ class LocationViewSet(viewsets.ReadOnlyModelViewSet):
# Location fields
'building',
'address',
'on_campus'
'on_campus',
'campus_region'
)
# Associate a serializer with the ViewSet
......@@ -346,6 +347,7 @@ class FacilityViewSet(viewsets.ReadOnlyModelViewSet):
'facility_location__building',
'facility_location__address',
'facility_location__on_campus',
'facility_location__campus_region',
# Schedule fields
'main_schedule__name',
'main_schedule__valid_start',
......
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