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
SRCT
whats-open
Commits
17d2129c
Commit
17d2129c
authored
Jul 26, 2019
by
Michael Lundquist
Browse files
Here are the changes, but I haven't tested it yet.
parent
e64903ee
Pipeline
#4501
failed with stage
in 26 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
17d2129c
...
...
@@ -120,19 +120,9 @@ Installing Docker on your system:
Additionally, you will need to install docker-compose: https://docs.docker.com/compose/install/
Next i
nside the
`whats-open/`
root directory run:
I
nside the
`whats-open/`
root directory run:
docker build . -t 'whats-open-api'
This builds the docker image that we will deploy to the swarm in a stack.
Initialize your swarm:
docker swarm init
And finally,
docker stack deploy whats-open-api_stack -c docker-compose.yml
docker-compose up
You should see that the server is running by going to http://localhost:8000
in your browser. Any changes you make to your local file system will be mirrored in the server.
...
...
whats-open/api/views.py
View file @
17d2129c
...
...
@@ -111,12 +111,6 @@ class AlertViewSet(viewsets.ReadOnlyModelViewSet):
# Associate a serializer with the ViewSet
serializer_class
=
AlertSerializer
# Setup filtering
filter_backends
=
(
filters
.
SearchFilter
,
DjangoFilterBackend
,
filters
.
OrderingFilter
,
)
search_fields
=
FILTER_FIELDS
ordering_fields
=
FILTER_FIELDS
filter_fields
=
FILTER_FIELDS
...
...
@@ -208,12 +202,7 @@ class CategoryViewSet(viewsets.ReadOnlyModelViewSet):
# Associate a serializer with the ViewSet
serializer_class
=
CategorySerializer
# Setup filtering
filter_backends
=
(
filters
.
SearchFilter
,
DjangoFilterBackend
,
filters
.
OrderingFilter
,
)
search_fields
=
FILTER_FIELDS
ordering_fields
=
FILTER_FIELDS
filter_fields
=
FILTER_FIELDS
...
...
@@ -292,12 +281,6 @@ class LocationViewSet(viewsets.ReadOnlyModelViewSet):
# Associate a serializer with the ViewSet
serializer_class
=
LocationSerializer
# Setup filtering
filter_backends
=
(
filters
.
SearchFilter
,
DjangoFilterBackend
,
filters
.
OrderingFilter
,
)
search_fields
=
FILTER_FIELDS
ordering_fields
=
FILTER_FIELDS
filter_fields
=
FILTER_FIELDS
...
...
@@ -408,12 +391,6 @@ class FacilityViewSet(viewsets.ReadOnlyModelViewSet):
# Associate a serializer with the ViewSet
serializer_class
=
FacilitySerializer
# Setup filtering
filter_backends
=
(
filters
.
SearchFilter
,
DjangoFilterBackend
,
filters
.
OrderingFilter
,
)
search_fields
=
FILTER_FIELDS
ordering_fields
=
FILTER_FIELDS
filter_fields
=
FILTER_FIELDS
...
...
@@ -513,12 +490,6 @@ class ScheduleViewSet(viewsets.ModelViewSet):
# Associate a serializer with the ViewSet
serializer_class
=
ScheduleSerializer
# Setup filtering
filter_backends
=
(
filters
.
SearchFilter
,
DjangoFilterBackend
,
filters
.
OrderingFilter
,
)
search_fields
=
FILTER_FIELDS
ordering_fields
=
FILTER_FIELDS
filter_fields
=
FILTER_FIELDS
...
...
whats-open/settings/settings.py
View file @
17d2129c
...
...
@@ -271,7 +271,8 @@ REST_FRAMEWORK = {
'DEFAULT_FILTER_BACKENDS'
:
[
#'url_filter.integrations.drf.URLFilterBackend', #url_filters
"django_filters.rest_framework.DjangoFilterBackend"
,
#rest_framework.filters
"rest_framework.filters.OrderingFilter"
"rest_framework.filters.OrderingFilter"
,
"rest_framework.filters.SearchFilter"
,
],
}
...
...
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