udata 10.1.5.dev34573__py2.py3-none-any.whl → 10.1.5.dev34612__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of udata might be problematic. Click here for more details.
- udata/core/spatial/models.py +4 -6
- udata/tests/api/test_topics_api.py +17 -2
- {udata-10.1.5.dev34573.dist-info → udata-10.1.5.dev34612.dist-info}/METADATA +2 -1
- {udata-10.1.5.dev34573.dist-info → udata-10.1.5.dev34612.dist-info}/RECORD +8 -8
- {udata-10.1.5.dev34573.dist-info → udata-10.1.5.dev34612.dist-info}/LICENSE +0 -0
- {udata-10.1.5.dev34573.dist-info → udata-10.1.5.dev34612.dist-info}/WHEEL +0 -0
- {udata-10.1.5.dev34573.dist-info → udata-10.1.5.dev34612.dist-info}/entry_points.txt +0 -0
- {udata-10.1.5.dev34573.dist-info → udata-10.1.5.dev34612.dist-info}/top_level.txt +0 -0
udata/core/spatial/models.py
CHANGED
|
@@ -170,9 +170,7 @@ class SpatialCoverage(db.EmbeddedDocument):
|
|
|
170
170
|
return [zone for zone in self.zones if zone.handled_level]
|
|
171
171
|
|
|
172
172
|
def clean(self):
|
|
173
|
-
if
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
if self.geom:
|
|
178
|
-
raise db.ValidationError("The spatial coverage already has a Geometry")
|
|
173
|
+
if self.zones and self.geom:
|
|
174
|
+
raise db.ValidationError(
|
|
175
|
+
"The spatial coverage cannot contains a Geozone and a Geometry"
|
|
176
|
+
)
|
|
@@ -165,7 +165,7 @@ class TopicsAPITest(APITestCase):
|
|
|
165
165
|
assert topic.owner is None
|
|
166
166
|
assert topic.organization == org
|
|
167
167
|
|
|
168
|
-
def
|
|
168
|
+
def test_topic_api_create_spatial_zone(self):
|
|
169
169
|
paca, _, _ = create_geozones_fixtures()
|
|
170
170
|
granularity = spatial_granularities[0][0]
|
|
171
171
|
data = TopicFactory.as_dict()
|
|
@@ -173,7 +173,6 @@ class TopicsAPITest(APITestCase):
|
|
|
173
173
|
data["reuses"] = [str(r.id) for r in data["reuses"]]
|
|
174
174
|
data["spatial"] = {
|
|
175
175
|
"zones": [paca.id],
|
|
176
|
-
"geom": SAMPLE_GEOM,
|
|
177
176
|
"granularity": granularity,
|
|
178
177
|
}
|
|
179
178
|
self.login()
|
|
@@ -182,6 +181,22 @@ class TopicsAPITest(APITestCase):
|
|
|
182
181
|
self.assertEqual(Topic.objects.count(), 1)
|
|
183
182
|
topic = Topic.objects.first()
|
|
184
183
|
self.assertEqual([str(z) for z in topic.spatial.zones], [paca.id])
|
|
184
|
+
self.assertEqual(topic.spatial.granularity, granularity)
|
|
185
|
+
|
|
186
|
+
def test_topic_api_create_spatial_geom(self):
|
|
187
|
+
granularity = spatial_granularities[0][0]
|
|
188
|
+
data = TopicFactory.as_dict()
|
|
189
|
+
data["datasets"] = [str(d.id) for d in data["datasets"]]
|
|
190
|
+
data["reuses"] = [str(r.id) for r in data["reuses"]]
|
|
191
|
+
data["spatial"] = {
|
|
192
|
+
"geom": SAMPLE_GEOM,
|
|
193
|
+
"granularity": granularity,
|
|
194
|
+
}
|
|
195
|
+
self.login()
|
|
196
|
+
response = self.post(url_for("api.topics"), data)
|
|
197
|
+
self.assert201(response)
|
|
198
|
+
self.assertEqual(Topic.objects.count(), 1)
|
|
199
|
+
topic = Topic.objects.first()
|
|
185
200
|
self.assertEqual(topic.spatial.geom, SAMPLE_GEOM)
|
|
186
201
|
self.assertEqual(topic.spatial.granularity, granularity)
|
|
187
202
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: udata
|
|
3
|
-
Version: 10.1.5.
|
|
3
|
+
Version: 10.1.5.dev34612
|
|
4
4
|
Summary: Open data portal
|
|
5
5
|
Home-page: https://github.com/opendatateam/udata
|
|
6
6
|
Author: Opendata Team
|
|
@@ -141,6 +141,7 @@ It is collectively taken care of by members of the
|
|
|
141
141
|
|
|
142
142
|
## Current (in progress)
|
|
143
143
|
|
|
144
|
+
- Fix wrong error message when updating the GeoZone of a dataset with already a Geometry [#3271](https://github.com/opendatateam/udata/pull/3271)
|
|
144
145
|
- Update dependencies [#3278](https://github.com/opendatateam/udata/pull/3278)
|
|
145
146
|
- Some of these upgrades implied code changes in udata, udata-front or udata-ckan:
|
|
146
147
|
- upgrade bleach to 6.2.0
|
|
@@ -207,7 +207,7 @@ udata/core/spatial/constants.py,sha256=T024yKsXuBkaZ1MAFZPfLh2X_EFFVQ7Sfg4VHCmZQ
|
|
|
207
207
|
udata/core/spatial/factories.py,sha256=-eQupRrIOQLouw9Bvv4UBqizFKQ4l4CHZBht2cv7irE,3096
|
|
208
208
|
udata/core/spatial/forms.py,sha256=a6bYpRpuPZ9pZvZiLBZrhYQwwL4c7g686-Mknk9R0ek,3041
|
|
209
209
|
udata/core/spatial/geoids.py,sha256=-7MGX9Swe1Hfdla6QPL35xwm1dE3WVNmJaN3HPZQ99k,1159
|
|
210
|
-
udata/core/spatial/models.py,sha256=
|
|
210
|
+
udata/core/spatial/models.py,sha256=2S2ErmoyrCvCzs2tZmIZvbJmjBAcWzywp5kAZdwjtLU,5312
|
|
211
211
|
udata/core/spatial/tasks.py,sha256=1WVZkmgTbgrJ2-IF479hBzeO_5xtqflTNxHh7nzwnIw,229
|
|
212
212
|
udata/core/spatial/translations.py,sha256=hmtF45cOanPNGX4vBq4iItKwmMKWKcenThTO-DncC54,541
|
|
213
213
|
udata/core/spatial/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -630,7 +630,7 @@ udata/tests/api/test_reports_api.py,sha256=fCSz9NwMXBs6cxdXBVVI6y564AtovmZYw3xkg
|
|
|
630
630
|
udata/tests/api/test_reuses_api.py,sha256=d8mtUrDURIfnUK-sLogvAP-rOID2FDJ0UVTM0ravQ-Q,24642
|
|
631
631
|
udata/tests/api/test_swagger.py,sha256=eE6La9qdTYTIUFevRVPJgtj17Jq_8uOlsDwzCNR0LL8,760
|
|
632
632
|
udata/tests/api/test_tags_api.py,sha256=36zEBgthVEn6pctJ0kDgPmEaUr-iqRAHeZRcRG2LEXQ,2425
|
|
633
|
-
udata/tests/api/test_topics_api.py,sha256=
|
|
633
|
+
udata/tests/api/test_topics_api.py,sha256=mpIjztDEQ2fx25E9dl4eIARGqtYuh1w8x68PhRr47Ss,11651
|
|
634
634
|
udata/tests/api/test_transfer_api.py,sha256=-OLv-KjyLZL14J8UHl-ak_sYUj6wFiZWyoXC2SMXmEQ,7503
|
|
635
635
|
udata/tests/api/test_user_api.py,sha256=hfDHOv5F81tehbc5u3dYH5rAyYgzgHGCWVcGR3kLIZw,16591
|
|
636
636
|
udata/tests/apiv2/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -720,9 +720,9 @@ udata/translations/pt/LC_MESSAGES/udata.mo,sha256=Kd8IoZMPrZeWoMWeC_-hbcoy715a_o
|
|
|
720
720
|
udata/translations/pt/LC_MESSAGES/udata.po,sha256=77zeFKPGBQ6Rm9EPlOvdEM4xvNfW73nnkMvL6IJhx3M,46287
|
|
721
721
|
udata/translations/sr/LC_MESSAGES/udata.mo,sha256=imYa9TggDPt7LFyagrGBucZ6agZlINuoXZIbbiq0Ncw,29169
|
|
722
722
|
udata/translations/sr/LC_MESSAGES/udata.po,sha256=xH_QQlYBJMfB2Y0KPuGpca3jtxhB6xJ3WkDIQ8utbUc,53262
|
|
723
|
-
udata-10.1.5.
|
|
724
|
-
udata-10.1.5.
|
|
725
|
-
udata-10.1.5.
|
|
726
|
-
udata-10.1.5.
|
|
727
|
-
udata-10.1.5.
|
|
728
|
-
udata-10.1.5.
|
|
723
|
+
udata-10.1.5.dev34612.dist-info/LICENSE,sha256=V8j_M8nAz8PvAOZQocyRDX7keai8UJ9skgmnwqETmdY,34520
|
|
724
|
+
udata-10.1.5.dev34612.dist-info/METADATA,sha256=Jq7WaA9aj9zVFFTm3OuFaPw1gioHQf94RNYWGuNksgg,143594
|
|
725
|
+
udata-10.1.5.dev34612.dist-info/WHEEL,sha256=Kh9pAotZVRFj97E15yTA4iADqXdQfIVTHcNaZTjxeGM,110
|
|
726
|
+
udata-10.1.5.dev34612.dist-info/entry_points.txt,sha256=3SKiqVy4HUqxf6iWspgMqH8d88Htk6KoLbG1BU-UddQ,451
|
|
727
|
+
udata-10.1.5.dev34612.dist-info/top_level.txt,sha256=39OCg-VWFWOq4gCKnjKNu-s3OwFlZIu_dVH8Gl6ndHw,12
|
|
728
|
+
udata-10.1.5.dev34612.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|