geobox 1.2.3__py3-none-any.whl → 1.3.0__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.
- geobox/enums.py +1 -1
- geobox/user.py +32 -5
- geobox/vectorlayer.py +4 -1
- geobox/view.py +1 -27
- {geobox-1.2.3.dist-info → geobox-1.3.0.dist-info}/METADATA +1 -1
- {geobox-1.2.3.dist-info → geobox-1.3.0.dist-info}/RECORD +9 -9
- {geobox-1.2.3.dist-info → geobox-1.3.0.dist-info}/WHEEL +0 -0
- {geobox-1.2.3.dist-info → geobox-1.3.0.dist-info}/licenses/LICENSE +0 -0
- {geobox-1.2.3.dist-info → geobox-1.3.0.dist-info}/top_level.txt +0 -0
geobox/enums.py
CHANGED
geobox/user.py
CHANGED
|
@@ -36,6 +36,17 @@ class User(Base):
|
|
|
36
36
|
str: A string representation of the User instance.
|
|
37
37
|
"""
|
|
38
38
|
return f'User(id={self.id}, first_name={self.first_name}, last_name={self.last_name})'
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
@property
|
|
42
|
+
def role(self) -> 'UserRole':
|
|
43
|
+
"""
|
|
44
|
+
User role property
|
|
45
|
+
|
|
46
|
+
Returns:
|
|
47
|
+
UserRole: the user role
|
|
48
|
+
"""
|
|
49
|
+
return UserRole(self.data.get('role')) if self.data.get('role') else None
|
|
39
50
|
|
|
40
51
|
|
|
41
52
|
@property
|
|
@@ -94,6 +105,7 @@ class User(Base):
|
|
|
94
105
|
"""
|
|
95
106
|
params = {
|
|
96
107
|
'f': 'json',
|
|
108
|
+
'status': kwargs.get('status').value if kwargs.get('status') else None,
|
|
97
109
|
'q': kwargs.get('q'),
|
|
98
110
|
'search': kwargs.get('search'),
|
|
99
111
|
'search_fields': kwargs.get('search_fields'),
|
|
@@ -264,18 +276,33 @@ class User(Base):
|
|
|
264
276
|
>>> user.update_user(status=UserStatus.PENDING)
|
|
265
277
|
"""
|
|
266
278
|
data = {
|
|
267
|
-
"csrf_token": kwargs.get('csrf_token'),
|
|
268
279
|
"username": kwargs.get('username'),
|
|
269
280
|
"email": kwargs.get('email'),
|
|
270
281
|
"first_name": kwargs.get('first_name'),
|
|
271
282
|
"last_name": kwargs.get('last_name'),
|
|
272
|
-
"mobile": kwargs.get('mobile'),
|
|
273
283
|
"status": kwargs.get('status').value if kwargs.get('status') else None,
|
|
274
284
|
"role": kwargs.get('role').value if kwargs.get('role') else None,
|
|
275
|
-
"plan_id": kwargs.get('plan').id if kwargs.get('plan') else None,
|
|
276
|
-
"expiration_date": kwargs.get('expiration_date')
|
|
277
285
|
}
|
|
278
|
-
|
|
286
|
+
data = clean_data(data)
|
|
287
|
+
|
|
288
|
+
try:
|
|
289
|
+
data['mobile'] = None if kwargs['mobile'] == '' else kwargs['mobile']
|
|
290
|
+
except:
|
|
291
|
+
pass
|
|
292
|
+
|
|
293
|
+
try:
|
|
294
|
+
data['plan_id'] = None if kwargs['plan'] == '' else kwargs['plan'].id
|
|
295
|
+
except:
|
|
296
|
+
pass
|
|
297
|
+
|
|
298
|
+
try:
|
|
299
|
+
data['expiration_date'] = None if kwargs['expiration_date'] == '' else kwargs['expiration_date']
|
|
300
|
+
except:
|
|
301
|
+
pass
|
|
302
|
+
|
|
303
|
+
response = self.api.put(self.endpoint, data)
|
|
304
|
+
self._update_properties(response)
|
|
305
|
+
return response
|
|
279
306
|
|
|
280
307
|
|
|
281
308
|
def delete(self) -> None:
|
geobox/vectorlayer.py
CHANGED
|
@@ -454,7 +454,10 @@ class VectorLayer(Base):
|
|
|
454
454
|
>>> layer = VectorLayer.get_vector(api=client, uuid="12345678-1234-5678-1234-567812345678")
|
|
455
455
|
>>> layer.wfs
|
|
456
456
|
"""
|
|
457
|
-
|
|
457
|
+
if self.api.access_token:
|
|
458
|
+
return f'{self.api.base_url}{self.endpoint}wfs/'
|
|
459
|
+
elif self.api.apikey:
|
|
460
|
+
return f'{self.api.base_url}{self.endpoint}apikey:{self.api.apikey}/wfs/'
|
|
458
461
|
|
|
459
462
|
|
|
460
463
|
def get_fields(self) -> List['Field']:
|
geobox/view.py
CHANGED
|
@@ -164,7 +164,7 @@ class VectorLayerView(VectorLayer):
|
|
|
164
164
|
'include_settings': include_settings
|
|
165
165
|
}
|
|
166
166
|
return super()._get_list_by_ids(api=api,
|
|
167
|
-
endpoint=f'{cls.BASE_ENDPOINT}get-
|
|
167
|
+
endpoint=f'{cls.BASE_ENDPOINT}get-layers/',
|
|
168
168
|
params=params,
|
|
169
169
|
factory_func=lambda api, item: VectorLayerView(api, item['uuid'], LayerType(item['layer_type']), item))
|
|
170
170
|
|
|
@@ -407,32 +407,6 @@ class VectorLayerView(VectorLayer):
|
|
|
407
407
|
>>> field = view.get_field_by_name(name='test')
|
|
408
408
|
"""
|
|
409
409
|
return super().get_field_by_name(name)
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
def add_field(self, name: str, data_type: 'FieldType', data: Dict = {}) -> 'Field':
|
|
413
|
-
"""
|
|
414
|
-
Add a new field to the vector layer view.
|
|
415
|
-
|
|
416
|
-
Args:
|
|
417
|
-
name (str): The name of the new field.
|
|
418
|
-
data_type (FieldType): The data type of the new field.
|
|
419
|
-
data (Dict): Additional field properties (display_name, description, etc.).
|
|
420
|
-
|
|
421
|
-
Returns:
|
|
422
|
-
Field: The newly created field instance.
|
|
423
|
-
|
|
424
|
-
Raises:
|
|
425
|
-
ValidationError: If the field data is invalid.
|
|
426
|
-
ApiRequestError: If the API request fails.
|
|
427
|
-
|
|
428
|
-
Example:
|
|
429
|
-
>>> from geobox import GeoboxClient
|
|
430
|
-
>>> from geobox.view import VectorLayerView
|
|
431
|
-
>>> client = GeoboxClient()
|
|
432
|
-
>>> view = VectorLayerView.get_view(client, uuid="12345678-1234-5678-1234-567812345678")
|
|
433
|
-
>>> field = view.add_field(name="new_field", data_type=FieldType.String)
|
|
434
|
-
"""
|
|
435
|
-
return super().add_field(name, data_type, data)
|
|
436
410
|
|
|
437
411
|
|
|
438
412
|
def calculate_field(self, target_field: str, expression: str, q: str = None, bbox: List[float] = None,
|
|
@@ -5,7 +5,7 @@ geobox/attachment.py,sha256=XbGwfWWuFAMimj4tsjKBvlSLP-rhpNACCtxgRmUvcdY,11631
|
|
|
5
5
|
geobox/base.py,sha256=p0UVZo9CINw0mW9o0nNR_VNCk7V1r-FrLQ_NH39WARE,12299
|
|
6
6
|
geobox/basemap.py,sha256=fDWwkMf-F2NTE1tVLijoxQku55825b6gj8nk69TMOII,4386
|
|
7
7
|
geobox/dashboard.py,sha256=MYyT3YJEGPCbTXHcYoZmn14rFOaut1J3idEA8bCdFgI,11762
|
|
8
|
-
geobox/enums.py,sha256=
|
|
8
|
+
geobox/enums.py,sha256=eYD-SVXCSp4l08DlxymJTqYzTLouRziWhLZd7letnTM,6317
|
|
9
9
|
geobox/exception.py,sha256=jvpnv0M2Ck1FpxHTL_aKYWxGvLnCQ3d9vOrMIktjw1U,1507
|
|
10
10
|
geobox/feature.py,sha256=3Kbc1LjIkBt1YqRAry84BrR7qxx9BexvBB3YQ8D9mGk,18504
|
|
11
11
|
geobox/field.py,sha256=p9eitUpnsiGj6GUhjSomk6HWlsNJSbE-Oh_4VcjaqVo,10562
|
|
@@ -24,14 +24,14 @@ geobox/task.py,sha256=eLMgbhcYTADooWqKDPh6Jlh5S5oqxMMKoYIm0YPVZvg,13519
|
|
|
24
24
|
geobox/tile3d.py,sha256=MHDoj2OIUf3VMQtq7ysrayh8njAPSgwgPJCm4ySEB7A,10472
|
|
25
25
|
geobox/tileset.py,sha256=F_oEV0TERMc2seLcYNu-i_TF4MNSdXPUWcxBCSR8aFw,22242
|
|
26
26
|
geobox/usage.py,sha256=_54xL-n-2Bg9wGpoOBKnh85WqdpMWEtqxRJVaFlVWe0,7908
|
|
27
|
-
geobox/user.py,sha256=
|
|
27
|
+
geobox/user.py,sha256=k80q6THt0E9-xbMzIdKWNSb9dc_KKhLneru2GLggTGM,15085
|
|
28
28
|
geobox/utils.py,sha256=jKhEs6CWTSlJZDS5qw9O2KgkLnTL9GKvFyKJpp8n1fA,1116
|
|
29
|
-
geobox/vectorlayer.py,sha256=
|
|
29
|
+
geobox/vectorlayer.py,sha256=1xjhWpvb1hFhLRei2hwU7IY5KxDKzynZMb3fbIDTMZE,51092
|
|
30
30
|
geobox/version.py,sha256=0GLPhxCeEb2bAkdpPJWtXPXc1KP6kQ_TOMwLAL0ldo0,9374
|
|
31
|
-
geobox/view.py,sha256=
|
|
31
|
+
geobox/view.py,sha256=sIi6Mi7NUAX5gN83cpubD3l7AcZ-1g5kG2NKHeVeW-g,37518
|
|
32
32
|
geobox/workflow.py,sha256=6hKnSw4G0_ZlgmUb0g3fxT-UVsFbiYpF2FbEO5fpQv0,11606
|
|
33
|
-
geobox-1.
|
|
34
|
-
geobox-1.
|
|
35
|
-
geobox-1.
|
|
36
|
-
geobox-1.
|
|
37
|
-
geobox-1.
|
|
33
|
+
geobox-1.3.0.dist-info/licenses/LICENSE,sha256=AvFB7W94sJYKLDhBxLRshL3upexCOG8HQY_1JibB96w,1063
|
|
34
|
+
geobox-1.3.0.dist-info/METADATA,sha256=UW0-KY-DuDA4blEJeWwoP05fxSMQ-yOa7AjfIs0dzzg,2556
|
|
35
|
+
geobox-1.3.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
36
|
+
geobox-1.3.0.dist-info/top_level.txt,sha256=ppXH8Bu2mlB-pLQ6lsoWEm2Gr6wZx1uzkhetsYA5ins,7
|
|
37
|
+
geobox-1.3.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|