Commit e9ddd189 authored by Daniel W Bond's avatar Daniel W Bond
Browse files

added comments to point out where the building-floors and floor-rooms issue exists and why

parent a965fc13
......@@ -11,7 +11,9 @@ from accounts.models import Major
class BuildingSerializer(serializers.ModelSerializer):
floors = serializers.SerializerMethodField('get_building_floors')
# using django's built-in serialization makes for many escape characters
# and lots of unnecessary fields... there has to be a way to do this with DRF
#floors = serializers.SerializerMethodField('get_building_floors')
def get_building_floors(self, building):
floors = serialize('json', Floor.objects.filter(building=building),
......@@ -26,6 +28,7 @@ class BuildingSerializer(serializers.ModelSerializer):
class FloorSerializer(serializers.ModelSerializer):
building = serializers.SerializerMethodField('get_building_name')
#rooms = serializers.SerializerMethodField('get_floor_room')
def get_building_name(self, floor):
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