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

Integrate @dbond commits from 7-locations

- serializer work plus adoption of slug for Facility
parent be0b6f97
...@@ -51,7 +51,8 @@ class OpenTimeSerializer(serializers.ModelSerializer): ...@@ -51,7 +51,8 @@ class OpenTimeSerializer(serializers.ModelSerializer):
# Choose the model to be serialized # Choose the model to be serialized
model = OpenTime model = OpenTime
# Serialize all of the fields # Serialize all of the fields
fields = '__all__' fields = ('schedule', 'modified',
'start_day', 'end_day', 'start_time', 'end_time')
class ScheduleSerializer(serializers.ModelSerializer): class ScheduleSerializer(serializers.ModelSerializer):
""" """
...@@ -93,6 +94,7 @@ class FacilitySerializer(serializers.HyperlinkedModelSerializer): ...@@ -93,6 +94,7 @@ class FacilitySerializer(serializers.HyperlinkedModelSerializer):
# Choose the model to be serialized # Choose the model to be serialized
model = Facility model = Facility
# List the fields that we are serializing # List the fields that we are serializing
fields = ('id', 'facility_category', 'facility_location', fields = ('slug', 'facility_name', 'facility_location', 'facility_category',
'facility_product_tags', 'tapingo_url', 'main_schedule', 'facility_product_tags', 'tapingo_url',
'special_schedules', 'modified', 'facility_name') 'main_schedule', 'special_schedules',
'modified', )
...@@ -390,6 +390,7 @@ class FacilityViewSet(viewsets.ReadOnlyModelViewSet): ...@@ -390,6 +390,7 @@ class FacilityViewSet(viewsets.ReadOnlyModelViewSet):
search_fields = FILTER_FIELDS search_fields = FILTER_FIELDS
ordering_fields = FILTER_FIELDS ordering_fields = FILTER_FIELDS
filter_fields = FILTER_FIELDS filter_fields = FILTER_FIELDS
lookup_field = 'slug'
def get_queryset(self): def get_queryset(self):
""" """
......
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