From 4b9e8452fb3e3ea6f034c7352ffd9dffed527d71 Mon Sep 17 00:00:00 2001 From: wlorenzetti Date: Tue, 19 Sep 2023 09:48:32 +0200 Subject: [PATCH 1/2] Fix test editing fi QGIS Join --- ..._54d40b01_2af8_4b17_8495_c5833485536e.json | 751 ++++++++---------- g3w-admin/editing/tests/data/logging_test.db | Bin 5591040 -> 5591040 bytes g3w-admin/editing/tests/test_api.py | 1 + 3 files changed, 323 insertions(+), 429 deletions(-) diff --git a/g3w-admin/editing/tests/data/api/editing_api_config_cities_54d40b01_2af8_4b17_8495_c5833485536e.json b/g3w-admin/editing/tests/data/api/editing_api_config_cities_54d40b01_2af8_4b17_8495_c5833485536e.json index 3fc05eec1..ee0ee4bd3 100644 --- a/g3w-admin/editing/tests/data/api/editing_api_config_cities_54d40b01_2af8_4b17_8495_c5833485536e.json +++ b/g3w-admin/editing/tests/data/api/editing_api_config_cities_54d40b01_2af8_4b17_8495_c5833485536e.json @@ -1,431 +1,324 @@ { - "result":true, - "vector":{ - "format":"GeoJSON", - "count":null, - "data":null, - "geometrytype":"Point", - "fields":[ - { - "name":"ogc_fid", - "type":"bigint", - "label":"ogc_fid", - "editable":false, - "validate":{ - "required":true, - "unique":true - }, - "pk":true, - "default":"Autogenerate", - "input":{ - "type":"text", - "options":{ - - } - } - }, - { - "name":"geonameid", - "type":"bigint", - "label":"geonameid", - "editable":true, - "validate":{ - - }, - "pk":false, - "default":"", - "input":{ - "type":"text", - "options":{ - - } - } - }, - { - "name":"name", - "type":"varchar", - "label":"name", - "editable":true, - "validate":{ - - }, - "pk":false, - "default":"", - "input":{ - "type":"text", - "options":{ - - } - } - }, - { - "name":"asciiname", - "type":"varchar", - "label":"asciiname", - "editable":true, - "validate":{ - - }, - "pk":false, - "default":"", - "input":{ - "type":"text", - "options":{ - - } - } - }, - { - "name":"iso2_code", - "type":"varchar", - "label":"iso2_code", - "editable":true, - "validate":{ - - }, - "pk":false, - "default":"", - "input":{ - "type":"text", - "options":{ - - } - } - }, - { - "name":"population", - "type":"bigint", - "label":"population", - "editable":true, - "validate":{ - - }, - "pk":false, - "default":"", - "input":{ - "type":"text", - "options":{ - - } - } - }, - { - "name":"gtopo30", - "type":"bigint", - "label":"gtopo30", - "editable":true, - "validate":{ - - }, - "pk":false, - "default":"", - "input":{ - "type":"text", - "options":{ - - } - } - }, - { - "name":"countries_ogc_fid", - "type":"bigint", - "label":"countries_ogc_fid", - "editable":false, - "validate":{ - "required":true, - "unique":true - }, - "pk":"", - "default":"", - "input":{ - "type":"text", - "options":{ - - } - } - }, - { - "name":"countries_name_local", - "type":"varchar", - "label":"countries_name_local", - "editable":false, - "validate":{ - - }, - "pk":false, - "default":"", - "input":{ - "type":"text", - "options":{ - - } - } - }, - { - "name":"countries_name_en", - "type":"varchar", - "label":"countries_name_en", - "editable":false, - "validate":{ - - }, - "pk":false, - "default":"", - "input":{ - "type":"text", - "options":{ - - } - } - }, - { - "name":"countries_capital_en", - "type":"varchar", - "label":"countries_capital_en", - "editable":false, - "validate":{ - - }, - "pk":false, - "default":"", - "input":{ - "type":"text", - "options":{ - - } - } - }, - { - "name":"countries_name_de", - "type":"varchar", - "label":"countries_name_de", - "editable":false, - "validate":{ - - }, - "pk":false, - "default":"", - "input":{ - "type":"text", - "options":{ - - } - } - }, - { - "name":"countries_capital_de", - "type":"varchar", - "label":"countries_capital_de", - "editable":false, - "validate":{ - - }, - "pk":false, - "default":"", - "input":{ - "type":"text", - "options":{ - - } - } - }, - { - "name":"countries_name_it", - "type":"varchar", - "label":"countries_name_it", - "editable":false, - "validate":{ - - }, - "pk":false, - "default":"", - "input":{ - "type":"text", - "options":{ - - } - } - }, - { - "name":"countries_capital_it", - "type":"varchar", - "label":"countries_capital_it", - "editable":false, - "validate":{ - - }, - "pk":false, - "default":"", - "input":{ - "type":"text", - "options":{ - - } - } - }, - { - "name":"countries_name_fr", - "type":"varchar", - "label":"countries_name_fr", - "editable":false, - "validate":{ - - }, - "pk":false, - "default":"", - "input":{ - "type":"text", - "options":{ - - } - } - }, - { - "name":"countries_capital_fr", - "type":"varchar", - "label":"countries_capital_fr", - "editable":false, - "validate":{ - - }, - "pk":false, - "default":"", - "input":{ - "type":"text", - "options":{ - - } - } - }, - { - "name":"countries_name_br", - "type":"varchar", - "label":"countries_name_br", - "editable":false, - "validate":{ - - }, - "pk":false, - "default":"", - "input":{ - "type":"text", - "options":{ - - } - } - }, - { - "name":"countries_capital_br", - "type":"varchar", - "label":"countries_capital_br", - "editable":false, - "validate":{ - - }, - "pk":false, - "default":"", - "input":{ - "type":"text", - "options":{ - - } - } - }, - { - "name":"countries_name_es", - "type":"varchar", - "label":"countries_name_es", - "editable":false, - "validate":{ - - }, - "pk":false, - "default":"", - "input":{ - "type":"text", - "options":{ - - } - } - }, - { - "name":"countries_capital_es", - "type":"varchar", - "label":"countries_capital_es", - "editable":false, - "validate":{ - - }, - "pk":false, - "default":"", - "input":{ - "type":"text", - "options":{ - - } - } - }, - { - "name":"countries_population", - "type":"bigint", - "label":"countries_population", - "editable":false, - "validate":{ - - }, - "pk":false, - "default":"", - "input":{ - "type":"text", - "options":{ - - } - } - }, - { - "name":"countries_area_km2", - "type":"bigint", - "label":"countries_area_km2", - "editable":false, - "validate":{ - - }, - "pk":false, - "default":"", - "input":{ - "type":"text", - "options":{ - - } - } - }, - { - "name":"countries_iso_num", - "type":"bigint", - "label":"countries_iso_num", - "editable":false, - "validate":{ - - }, - "pk":false, - "default":"", - "input":{ - "type":"text", - "options":{ - - } - } - } - ] - }, - "featurelocks":null, - "constraints":{ - - }, - "capabilities": [ - "add_feature", - "change_feature", - "delete_feature", - "change_attr_feature" - ] + "result": true, + "vector": { + "format": "GeoJSON", + "count": null, + "data": null, + "geometrytype": "Point", + "fields": [{ + "name": "ogc_fid", + "type": "bigint", + "label": "ogc_fid", + "editable": false, + "validate": { + "required": true, + "unique": true + }, + "pk": true, + "default": "Autogenerate", + "input": { + "type": "text", + "options": {} + } + }, { + "name": "geonameid", + "type": "bigint", + "label": "geonameid", + "editable": true, + "validate": {}, + "pk": false, + "default": "", + "input": { + "type": "text", + "options": {} + } + }, { + "name": "name", + "type": "varchar", + "label": "name", + "editable": true, + "validate": {}, + "pk": false, + "default": "", + "input": { + "type": "text", + "options": {} + } + }, { + "name": "asciiname", + "type": "varchar", + "label": "asciiname", + "editable": true, + "validate": {}, + "pk": false, + "default": "", + "input": { + "type": "text", + "options": {} + } + }, { + "name": "iso2_code", + "type": "varchar", + "label": "iso2_code", + "editable": true, + "validate": {}, + "pk": false, + "default": "", + "input": { + "type": "text", + "options": {} + } + }, { + "name": "population", + "type": "bigint", + "label": "population", + "editable": true, + "validate": {}, + "pk": false, + "default": "", + "input": { + "type": "text", + "options": {} + } + }, { + "name": "gtopo30", + "type": "bigint", + "label": "gtopo30", + "editable": true, + "validate": {}, + "pk": false, + "default": "", + "input": { + "type": "text", + "options": {} + } + }, { + "name": "countries_ogc_fid", + "type": "bigint", + "label": "countries_ogc_fid", + "editable": false, + "validate": { + "required": true, + "unique": true + }, + "pk": false, + "default": "", + "input": { + "type": "text", + "options": {} + }, + "vectorjoin_id": "cities_54d40b01_2af8_4b17_8495_c5833485536e_vectorjoin_0" + }, { + "name": "countries_name_local", + "type": "varchar", + "label": "countries_name_local", + "editable": false, + "validate": {}, + "pk": false, + "default": "", + "input": { + "type": "text", + "options": {} + }, + "vectorjoin_id": "cities_54d40b01_2af8_4b17_8495_c5833485536e_vectorjoin_0" + }, { + "name": "countries_name_en", + "type": "varchar", + "label": "countries_name_en", + "editable": false, + "validate": {}, + "pk": false, + "default": "", + "input": { + "type": "text", + "options": {} + }, + "vectorjoin_id": "cities_54d40b01_2af8_4b17_8495_c5833485536e_vectorjoin_0" + }, { + "name": "countries_capital_en", + "type": "varchar", + "label": "countries_capital_en", + "editable": false, + "validate": {}, + "pk": false, + "default": "", + "input": { + "type": "text", + "options": {} + }, + "vectorjoin_id": "cities_54d40b01_2af8_4b17_8495_c5833485536e_vectorjoin_0" + }, { + "name": "countries_name_de", + "type": "varchar", + "label": "countries_name_de", + "editable": false, + "validate": {}, + "pk": false, + "default": "", + "input": { + "type": "text", + "options": {} + }, + "vectorjoin_id": "cities_54d40b01_2af8_4b17_8495_c5833485536e_vectorjoin_0" + }, { + "name": "countries_capital_de", + "type": "varchar", + "label": "countries_capital_de", + "editable": false, + "validate": {}, + "pk": false, + "default": "", + "input": { + "type": "text", + "options": {} + }, + "vectorjoin_id": "cities_54d40b01_2af8_4b17_8495_c5833485536e_vectorjoin_0" + }, { + "name": "countries_name_it", + "type": "varchar", + "label": "countries_name_it", + "editable": false, + "validate": {}, + "pk": false, + "default": "", + "input": { + "type": "text", + "options": {} + }, + "vectorjoin_id": "cities_54d40b01_2af8_4b17_8495_c5833485536e_vectorjoin_0" + }, { + "name": "countries_capital_it", + "type": "varchar", + "label": "countries_capital_it", + "editable": false, + "validate": {}, + "pk": false, + "default": "", + "input": { + "type": "text", + "options": {} + }, + "vectorjoin_id": "cities_54d40b01_2af8_4b17_8495_c5833485536e_vectorjoin_0" + }, { + "name": "countries_name_fr", + "type": "varchar", + "label": "countries_name_fr", + "editable": false, + "validate": {}, + "pk": false, + "default": "", + "input": { + "type": "text", + "options": {} + }, + "vectorjoin_id": "cities_54d40b01_2af8_4b17_8495_c5833485536e_vectorjoin_0" + }, { + "name": "countries_capital_fr", + "type": "varchar", + "label": "countries_capital_fr", + "editable": false, + "validate": {}, + "pk": false, + "default": "", + "input": { + "type": "text", + "options": {} + }, + "vectorjoin_id": "cities_54d40b01_2af8_4b17_8495_c5833485536e_vectorjoin_0" + }, { + "name": "countries_name_br", + "type": "varchar", + "label": "countries_name_br", + "editable": false, + "validate": {}, + "pk": false, + "default": "", + "input": { + "type": "text", + "options": {} + }, + "vectorjoin_id": "cities_54d40b01_2af8_4b17_8495_c5833485536e_vectorjoin_0" + }, { + "name": "countries_capital_br", + "type": "varchar", + "label": "countries_capital_br", + "editable": false, + "validate": {}, + "pk": false, + "default": "", + "input": { + "type": "text", + "options": {} + }, + "vectorjoin_id": "cities_54d40b01_2af8_4b17_8495_c5833485536e_vectorjoin_0" + }, { + "name": "countries_name_es", + "type": "varchar", + "label": "countries_name_es", + "editable": false, + "validate": {}, + "pk": false, + "default": "", + "input": { + "type": "text", + "options": {} + }, + "vectorjoin_id": "cities_54d40b01_2af8_4b17_8495_c5833485536e_vectorjoin_0" + }, { + "name": "countries_capital_es", + "type": "varchar", + "label": "countries_capital_es", + "editable": false, + "validate": {}, + "pk": false, + "default": "", + "input": { + "type": "text", + "options": {} + }, + "vectorjoin_id": "cities_54d40b01_2af8_4b17_8495_c5833485536e_vectorjoin_0" + }, { + "name": "countries_population", + "type": "bigint", + "label": "countries_population", + "editable": false, + "validate": {}, + "pk": false, + "default": "", + "input": { + "type": "text", + "options": {} + }, + "vectorjoin_id": "cities_54d40b01_2af8_4b17_8495_c5833485536e_vectorjoin_0" + }, { + "name": "countries_area_km2", + "type": "bigint", + "label": "countries_area_km2", + "editable": false, + "validate": {}, + "pk": false, + "default": "", + "input": { + "type": "text", + "options": {} + }, + "vectorjoin_id": "cities_54d40b01_2af8_4b17_8495_c5833485536e_vectorjoin_0" + }, { + "name": "countries_iso_num", + "type": "bigint", + "label": "countries_iso_num", + "editable": false, + "validate": {}, + "pk": false, + "default": "", + "input": { + "type": "text", + "options": {} + }, + "vectorjoin_id": "cities_54d40b01_2af8_4b17_8495_c5833485536e_vectorjoin_0" + }] + }, + "featurelocks": null, + "constraints": {}, + "capabilities": ["add_feature", "change_feature", "delete_feature", "change_attr_feature"] } \ No newline at end of file diff --git a/g3w-admin/editing/tests/data/logging_test.db b/g3w-admin/editing/tests/data/logging_test.db index b5c75561c4eb75a0c57766f4c76f1c35e21a5aac..08ea2f2dd9d7d069096dee8be7773af92ec09b5e 100644 GIT binary patch delta 470 zcmW;Iy*~nR0LSsJyHM!Ym4~CaJme|mx=P7INS?Xm8kkM~ie9eV zYOz>+GQ2;_cl*{K-`#cGhNakDq~wXYl98w9tA-`Xjh1!OvLv`6LxBff=td8`@Szud z=!YKy0jLNfgaHg<2*c1Yf>DGK!5GG&BZ>)3VhYoUVFt69!#oxc$08C)VhILPFp)+E zSu7)mJXTP^D%P-$4HU77Eo`HN9h9+)J?!HEhd9D9PH>9OcNLtW>a?u$kI!H_VVbs) zFJ$utGnLF`&C6yqWNZIZ*D;D4 z7{g86!Z;>S#BEIC4({UccTcS5~UD=HT9^wq>G%`;5b*Rr%I8$?$mvM#Il9#xG>xmq@?a^=DD zL-TJ4O;AcJlbgALlB3I=Cvzhx?C9gY s=<#&Zy)U2tn2|xLz6>05@FvUH||9 diff --git a/g3w-admin/editing/tests/test_api.py b/g3w-admin/editing/tests/test_api.py index 0d708b1c1..fced001ef 100644 --- a/g3w-admin/editing/tests/test_api.py +++ b/g3w-admin/editing/tests/test_api.py @@ -176,6 +176,7 @@ def test_editing_api(self): # In more recent QGIS versions ogc_fid will have a required constraint try: + self.assertEqual(json.loads(response.content), res_expected) except AssertionError: actual = json.loads(response.content) From 13582aa60046511a6b076e17991ce5493d3ab02a Mon Sep 17 00:00:00 2001 From: wlorenzetti Date: Tue, 19 Sep 2023 09:51:41 +0200 Subject: [PATCH 2/2] For documentation. --- g3w-admin/core/utils/structure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/g3w-admin/core/utils/structure.py b/g3w-admin/core/utils/structure.py index 2d96b0eef..ee6f2c5d0 100644 --- a/g3w-admin/core/utils/structure.py +++ b/g3w-admin/core/utils/structure.py @@ -141,7 +141,7 @@ def editingFormField(fieldName, type=FIELD_TYPE_STRING, editable=True, required= def mapLayerAttributes(layer, formField=False, **kwargs): """ - Map database columns data from layer by type for client editing + Map database columns data from layer by type for client """ mappingData = FIELD_TYPES_MAPPING