Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Hunter T Jozwiak
whats-open
Commits
4836ea4c
Verified
Commit
4836ea4c
authored
Jul 22, 2017
by
David Haynes
🙆
Browse files
Integrate @dbond commits from 7-locations
- serializer work plus adoption of slug for Facility
parent
be0b6f97
Changes
2
Hide whitespace changes
Inline
Side-by-side
whats-open/api/serializers.py
View file @
4836ea4c
...
@@ -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'
,
)
whats-open/api/views.py
View file @
4836ea4c
...
@@ -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
):
"""
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment