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

happy times are here again for serializers on drf 3.3+

parent 17379e27
......@@ -4,18 +4,18 @@ from website.models import Category, Facility, Schedule, OpenTime
class CategorySerializer(serializers.ModelSerializer):
class Meta:
model = Category
#fields = '__all__'
fields = '__all__'
class OpenTimeSerializer(serializers.ModelSerializer):
class Meta:
model = OpenTime
#fields = '__all__'
fields = '__all__'
class ScheduleSerializer(serializers.ModelSerializer):
open_times = OpenTimeSerializer(many=True, read_only=True)
class Meta:
model = Schedule
#fields = ( 'id', 'open_times', 'last_modified', 'name', 'valid_start', 'valid_end' )
fields = ( 'id', 'open_times', 'modified', 'name', 'valid_start', 'valid_end' )
class FacilitySerializer(serializers.HyperlinkedModelSerializer):
category = CategorySerializer(many=False, read_only=True)
......
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