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

facility_category and facility_location now display in API response

- before they existed but were not displayed
- apparently the variable names need to be the same and they were not
	- this fixes that
parent 4b573430
......@@ -3,7 +3,7 @@ from __future__ import (absolute_import, division, print_function,
unicode_literals)
# App Imports
from .models import Category, Facility, Schedule, OpenTime
from .models import Category, Facility, Schedule, OpenTime, Location
# Other Imports
from rest_framework import serializers
......@@ -15,6 +15,14 @@ class CategorySerializer(serializers.ModelSerializer):
model = Category
fields = '__all__'
class LocationSerializer(serializers.ModelSerializer):
"""
"""
class Meta:
model = Location
fields = '__all__'
class OpenTimeSerializer(serializers.ModelSerializer):
"""
"""
......@@ -35,11 +43,12 @@ class ScheduleSerializer(serializers.ModelSerializer):
class FacilitySerializer(serializers.HyperlinkedModelSerializer):
"""
"""
category = CategorySerializer(many=False, read_only=True)
facility_category = CategorySerializer(many=False, read_only=True)
facility_location = LocationSerializer(many=False, read_only=True)
main_schedule = ScheduleSerializer(many=False, read_only=True)
special_schedules = ScheduleSerializer(many=True, read_only=True)
class Meta:
model = Facility
fields = ('id', 'category', 'main_schedule', 'special_schedules',
'modified', 'name')
fields = ('id', 'facility_category', 'facility_location', 'main_schedule',
'special_schedules', 'modified', 'name')
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