Skip to content

Commit

Permalink
1.0.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier committed May 9, 2022
1 parent f2dc812 commit d137601
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 16 deletions.
15 changes: 15 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
Changelog
=========

Version 1.0.0 [2022-05-09]
--------------------------

Features
~~~~~~~~

- Added support Bounding Box to ``GeometryField`` via the ``auto_bbox``
initialization argument

Bugfixes
~~~~~~~~

- Avoid ``default_app_config`` Deprecation Warning in Django >= 3.2
- Fixed deserialization of the ``id_field``

Version 0.18.0 [2022-01-07]
---------------------------

Expand Down
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Compatibility with DRF, Django and Python

======================== ============================ ==================== ==================================
DRF-gis version DRF version Django version Python version
**1.0.x** **3.10** up to **3.13** **2.2 to 4.0** **3.6** to **3.9**
**0.18.x** **3.10** up to **3.13** **2.2 to 4.0** **3.6** to **3.9**
**0.17.x** **3.10** up to **3.12** **2.2 to 3.1** **3.6** to **3.8**
**0.16.x** **3.10** **2.2 to 3.1** **3.6** to **3.8**
Expand Down
2 changes: 1 addition & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ psycopg2~=2.8.0
django-filter>=2.0
contexttimer
# QA checks
openwisp-utils[qa]~=0.7.0
openwisp-utils[qa]~=1.0.0
packaging~=20.4
2 changes: 1 addition & 1 deletion rest_framework_gis/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = (0, 18, 0, 'final')
VERSION = (1, 0, 0, 'final')
__version__ = VERSION # alias


Expand Down
14 changes: 7 additions & 7 deletions tests/django_restframework_gis_tests/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@


class LocationGeoSerializer(serializers.ModelSerializer):
""" location geo serializer """
"""location geo serializer"""

details = serializers.HyperlinkedIdentityField(view_name='api_location_details')

Expand All @@ -59,7 +59,7 @@ class PaginatedLocationGeoSerializer(pagination.PageNumberPagination):


class LocationGeoFeatureSerializer(gis_serializers.GeoFeatureModelSerializer):
""" location geo serializer """
"""location geo serializer"""

details = serializers.HyperlinkedIdentityField(
view_name='api_geojson_location_details'
Expand All @@ -76,7 +76,7 @@ class Meta:


class LocationGeoFeatureSlugSerializer(LocationGeoFeatureSerializer):
""" use slug as id attribute """
"""use slug as id attribute"""

class Meta:
model = Location
Expand All @@ -86,7 +86,7 @@ class Meta:


class LocationGeoFeatureFalseIdSerializer(LocationGeoFeatureSerializer):
""" id attribute set as False """
"""id attribute set as False"""

class Meta:
model = Location
Expand All @@ -108,7 +108,7 @@ class Meta:


class LocationGeoFeatureWritableIdSerializer(LocationGeoFeatureSerializer):
""" default id attribute """
"""default id attribute"""

class Meta:
model = Location
Expand All @@ -119,7 +119,7 @@ class Meta:


class LocatedFileGeoFeatureSerializer(gis_serializers.GeoFeatureModelSerializer):
""" located file geo serializer """
"""located file geo serializer"""

details = serializers.HyperlinkedIdentityField(
view_name='api_geojson_located_file_details'
Expand All @@ -137,7 +137,7 @@ class Meta:


class BoxedLocationGeoFeatureSerializer(gis_serializers.GeoFeatureModelSerializer):
""" location geo serializer """
"""location geo serializer"""

details = serializers.HyperlinkedIdentityField(
view_name='api_geojson_boxedlocation_details'
Expand Down
2 changes: 1 addition & 1 deletion tests/django_restframework_gis_tests/test_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class TestRestFrameworkGisPerformance(TestCase):
NUMBER_OF_LOCATIONS = 10000

def _create_data(self):
""" creates a bunch of gis models instances """
"""creates a bunch of gis models instances"""
locations = []
name = 'l{0}'
slug = 'l{0}'
Expand Down
17 changes: 11 additions & 6 deletions tests/django_restframework_gis_tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def test_post_location_list_geojson(self):
self.assertEqual(Location.objects.count(), 2)

def test_post_location_list_geojson_as_multipartformdata(self):
""" emulate sending geojson string in webform """
"""emulate sending geojson string in webform"""
self.assertEqual(Location.objects.count(), 0)
data = {
"name": "geojson input test",
Expand Down Expand Up @@ -278,7 +278,7 @@ def test_post_location_list_invalid_geojson(self):
self.assertEqual(response.data['geometry'][0], self.gdal_error_message)

def test_geojson_format(self):
""" test geojson format """
"""test geojson format"""
location = Location.objects.create(
name='geojson test', geometry='POINT (135.0 45.0)'
)
Expand Down Expand Up @@ -339,7 +339,9 @@ def test_post_geojson_id_attribute(self):
}
url = reverse('api_geojson_location_writable_id_list')
response = self.client.post(
url, data=json.dumps(data), content_type='application/json',
url,
data=json.dumps(data),
content_type='application/json',
)
self.assertEqual(response.status_code, 201)
self.assertEqual(Location.objects.count(), 1)
Expand Down Expand Up @@ -489,7 +491,7 @@ def test_geofeatured_model_serializer_compatible_with_geomodel_serializer(self):
self.assertEqual(Location.objects.count(), 1)

def test_geofeatured_model_post_as_multipartformdata(self):
""" emulate sending geojson string in webform """
"""emulate sending geojson string in webform"""
self.assertEqual(Location.objects.count(), 0)
data = {
"name": "geojson input test",
Expand Down Expand Up @@ -716,14 +718,17 @@ def test_geojson_pagination(self):
def test_pickle(self):
geometry = GEOSGeometry('POINT (30 10)')
geojsondict = GeoJsonDict(
(('type', geometry.geom_type), ('coordinates', geometry.coords),)
(
('type', geometry.geom_type),
('coordinates', geometry.coords),
)
)
pickled = pickle.dumps(geojsondict)
restored = pickle.loads(pickled)
self.assertEqual(restored, geojsondict)

def test_geometrycollection_geojson(self):
""" test geometry collection geojson behaviour """
"""test geometry collection geojson behaviour"""
location = Location.objects.create(
name='geometry collection geojson test',
geometry='GEOMETRYCOLLECTION ('
Expand Down

0 comments on commit d137601

Please sign in to comment.