-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #550 from kartoza/develop
Upgrading geonode to 4.0.3
- Loading branch information
Showing
44 changed files
with
1,558 additions
and
930 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
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 |
---|---|---|
@@ -1,23 +1,21 @@ | ||
psycopg2-binary==2.8.6 | ||
django-admin-sortable==2.1.8 | ||
django-braces==1.14.0 | ||
django-model-utils==1.4.0 | ||
django-pipeline==1.6.14 | ||
psycopg2-binary==2.9.5 | ||
django-admin-sortable==2.3 | ||
django-braces==1.15.0 | ||
django-model-utils==4.3.1 | ||
django-pipeline==2.1.0 | ||
django-preferences==1.0.0 | ||
django-role-permissions==2.2.0 | ||
django-role-permissions==3.1.1 | ||
|
||
raven==6.10.0 | ||
django-sentry==1.13.5 | ||
|
||
service_identity | ||
|
||
# igrac | ||
wagtail==2.9.3 | ||
wagtailmenus==3.1.3 | ||
openpyxl==3.0.5 | ||
wagtail==4.2.1 | ||
wagtailmenus==3.1.5 | ||
openpyxl==3.0.10 | ||
pyexcel-xls==0.7.0 | ||
pyexcel-xlsx==0.6.0 | ||
|
||
git+https://github.com/kartoza/[email protected] | ||
# git+https://github.com/kartoza/django-mapstore-adapter.git@geonode_latest | ||
# git+https://github.com/kartoza/[email protected] | ||
git+https://github.com/kartoza/[email protected] |
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 |
---|---|---|
|
@@ -29,3 +29,4 @@ | |
) | ||
|
||
DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage' | ||
STATIC_URL = '/static/' |
Submodule gwml2
updated
from 7f2999 to ab6ab2
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
Empty file.
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,67 @@ | ||
from geonode.base.api.serializers import ResourceBaseSerializer | ||
from geonode.base.models import ( | ||
ResourceBase, | ||
) | ||
from geonode.geoapps.models import GeoApp | ||
from geonode.maps.models import Map | ||
from rest_framework import serializers | ||
from rest_framework.response import Response | ||
from rest_framework.views import APIView | ||
|
||
from igrac.models.map_slug import MapSlugMapping | ||
|
||
|
||
class MapFeaturedSerializer(ResourceBaseSerializer): | ||
slug = serializers.SerializerMethodField() | ||
detail_url = serializers.SerializerMethodField() | ||
|
||
def get_slug(self, obj: ResourceBase): | ||
map_slug = MapSlugMapping.objects.filter(map=obj).first() | ||
if map_slug: | ||
return map_slug.slug | ||
return '' | ||
|
||
def get_detail_url(self, obj: ResourceBase): | ||
map_slug = MapSlugMapping.objects.filter(map=obj).first() | ||
if map_slug: | ||
return map_slug.slug | ||
return '' | ||
|
||
class Meta: | ||
model = ResourceBase | ||
name = ResourceBaseSerializer.Meta.name | ||
view_name = ResourceBaseSerializer.Meta.view_name | ||
fields = ResourceBaseSerializer.Meta.fields + ('slug',) | ||
|
||
|
||
class FeaturedMaps(APIView): | ||
def get(self, request, *args): | ||
featured_map = Map.objects.filter( | ||
featured=True | ||
).order_by( | ||
'mapslugmapping__order', 'id' | ||
) | ||
serializer = MapFeaturedSerializer( | ||
featured_map, | ||
many=True | ||
) | ||
resources = serializer.data | ||
resources += ResourceBaseSerializer( | ||
GeoApp.objects.filter(featured=True, resource_type='dashboard'), | ||
many=True | ||
).data | ||
resources += ResourceBaseSerializer( | ||
GeoApp.objects.filter(featured=True, resource_type='geostory'), | ||
many=True | ||
).data | ||
|
||
return Response({ | ||
"links": { | ||
"next": None, | ||
"previous": None | ||
}, | ||
"total": featured_map.count(), | ||
"page": 1, | ||
"page_size": 99, | ||
"resources": resources | ||
}) |
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
Oops, something went wrong.