aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/serializers
diff options
context:
space:
mode:
authorParker Berberian <pberberian@iol.unh.edu>2019-12-19 12:39:01 -0500
committerParker Berberian <pberberian@iol.unh.edu>2020-01-28 16:09:35 -0500
commit77377d5e9362bd35a3b300df231e82ee974675e1 (patch)
tree5e3799768eb887a0259c8c21ed61123cdde2d608 /src/api/serializers
parent899e1a4baa95d0bc6f0eef34de66f0e257174878 (diff)
Comments and Documentation
This change adds a ton of comments and documentation across all the code. Change-Id: Ifee0a2f534e8584f14b0f13af4dda8dc70eb7553 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
Diffstat (limited to 'src/api/serializers')
-rw-r--r--src/api/serializers/booking_serializer.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/api/serializers/booking_serializer.py b/src/api/serializers/booking_serializer.py
index 9b5c059..46a2348 100644
--- a/src/api/serializers/booking_serializer.py
+++ b/src/api/serializers/booking_serializer.py
@@ -25,7 +25,8 @@ class BookingField(serializers.Field):
def to_representation(self, booking):
"""
- Takes in a booking object.
+ Take in a booking object.
+
Returns a dictionary of primitives representing that booking
"""
ser = {}
@@ -75,8 +76,7 @@ class BookingField(serializers.Field):
def to_internal_value(self, data):
"""
- Takes in a dictionary of primitives
- Returns a booking object
+ Take in a dictionary of primitives, and return a booking object.
This is not going to be implemented or allowed.
If someone needs to create a booking through the api,
@@ -146,9 +146,7 @@ class InterfaceField(serializers.Field):
pass
def to_internal_value(self, data):
- """
- takes in a serialized interface and creates an Interface model
- """
+ """Take in a serialized interface and creates an Interface model."""
mac = data['mac']
bus_address = data['busaddr']
switch_name = data['switchport']['switch_name']