This repository has been archived by the owner on Jun 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
2,091 additions
and
1,721 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Simple override in order to setup network for using thumbor image service | ||
volumes: | ||
static_root: | ||
|
||
services: | ||
web: # Name of this container should not be changed | ||
networks: | ||
- thumbor_network | ||
networks: | ||
# Use this network to communicate with thumbor image resize service | ||
# More information here: https://gitlab.com/geocity/thumbor-service | ||
thumbor_network: | ||
external: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
from rest_framework.pagination import PageNumberPagination | ||
from rest_framework.response import Response | ||
|
||
from geocity.apps.api.serializers import get_available_filters_for_agenda_as_json | ||
|
||
|
||
class CustomPagination(PageNumberPagination): | ||
def get_paginated_response(self, data): | ||
return Response( | ||
{ | ||
"links": { | ||
"next": self.get_next_link(), | ||
"previous": self.get_previous_link(), | ||
}, | ||
"numberReturned": self.page.paginator.count, | ||
"numberMatched": len(data), | ||
**data, | ||
} | ||
) | ||
|
||
|
||
class AgendaResultsSetPagination(PageNumberPagination): | ||
page_size = 20 | ||
page_size_query_param = "page_size" | ||
max_page_size = 100 | ||
|
||
def get_paginated_response(self, data): | ||
domain = self.request.GET.get("domain") | ||
agenda_filters = get_available_filters_for_agenda_as_json(domain) | ||
return Response( | ||
{ | ||
"type": "FeatureCollection", | ||
"crs": { | ||
"type": "name", | ||
"properties": {"name": "urn:ogc:def:crs:EPSG::2056"}, | ||
}, | ||
"next": self.get_next_link(), | ||
"previous": self.get_previous_link(), | ||
"count": self.page.paginator.count, | ||
"features": data, | ||
"filters": agenda_filters, | ||
} | ||
) |
Oops, something went wrong.