c2cgeoportal-commons 2.8.1.146__py3-none-any.whl → 2.9.0.350__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.
- c2cgeoportal_commons/__init__.py +1 -1
- c2cgeoportal_commons/alembic/env.py +14 -10
- c2cgeoportal_commons/alembic/main/028477929d13_add_technical_roles.py +2 -2
- c2cgeoportal_commons/alembic/main/04f05bfbb05e_remove_the_old_is_expanded_column.py +3 -1
- c2cgeoportal_commons/alembic/main/116b9b79fc4d_internal_and_external_layer_tables_.py +12 -12
- c2cgeoportal_commons/alembic/main/1418cb05921b_merge_1_6_and_master_branches.py +3 -1
- c2cgeoportal_commons/alembic/main/164ac0819a61_add_image_format_to_wmts_layer.py +2 -2
- c2cgeoportal_commons/alembic/main/166ff2dcc48d_create_database.py +3 -3
- c2cgeoportal_commons/alembic/main/16e43f8c0330_remove_old_metadata_column.py +2 -2
- c2cgeoportal_commons/alembic/main/1d5d4abfebd1_add_restricted_theme.py +2 -2
- c2cgeoportal_commons/alembic/main/1de20166b274_remove_v1_artifacts.py +2 -2
- c2cgeoportal_commons/alembic/main/20137477bd02_update_icons_url.py +2 -2
- c2cgeoportal_commons/alembic/main/21f11066f8ec_trigger_on_role_updates_user_in_static.py +2 -2
- c2cgeoportal_commons/alembic/main/22e6dfb556de_add_description_tree_.py +2 -2
- c2cgeoportal_commons/alembic/main/29f2a32859ec_merge_1_6_and_master_branches.py +3 -1
- c2cgeoportal_commons/alembic/main/2b8ed8c1df94_set_layergroup_treeitem_is_as_a_primary_.py +2 -2
- c2cgeoportal_commons/alembic/main/2e57710fecfe_update_the_ogc_server_for_ogc_api.py +77 -0
- c2cgeoportal_commons/alembic/main/32527659d57b_move_exclude_properties_from_layerv1_to_.py +2 -2
- c2cgeoportal_commons/alembic/main/32b21aa1d0ed_merge_e004f76e951a_and_e004f76e951a_.py +3 -1
- c2cgeoportal_commons/alembic/main/338b57593823_remove_trigger_on_role_name_change.py +2 -2
- c2cgeoportal_commons/alembic/main/415746eb9f6_changes_for_v2.py +2 -2
- c2cgeoportal_commons/alembic/main/44c91d82d419_add_table_log.py +8 -6
- c2cgeoportal_commons/alembic/main/5109242131ce_add_column_time_widget.py +4 -3
- c2cgeoportal_commons/alembic/main/52916d8fde8b_add_sql_fields_to_vector_tiles.py +5 -3
- c2cgeoportal_commons/alembic/main/53ba1a68d5fe_add_theme_to_fulltextsearch.py +2 -2
- c2cgeoportal_commons/alembic/main/54645a535ad6_add_ordering_in_relation.py +2 -2
- c2cgeoportal_commons/alembic/main/56dc90838d90_fix_removing_layerv1.py +2 -2
- c2cgeoportal_commons/alembic/main/596ba21e3833_separate_local_internal.py +2 -2
- c2cgeoportal_commons/alembic/main/678f88c7ad5e_add_vector_tiles_layers_table.py +2 -2
- c2cgeoportal_commons/alembic/main/6a412d9437b1_rename_serverogc_to_ogcserver.py +2 -2
- c2cgeoportal_commons/alembic/main/6d87fdad275a_convert_metadata_to_the_right_case.py +2 -2
- c2cgeoportal_commons/alembic/main/7530011a66a7_trigger_on_role_updates_user_in_static.py +2 -2
- c2cgeoportal_commons/alembic/main/78fd093c8393_add_api_s_intrfaces.py +15 -10
- c2cgeoportal_commons/alembic/main/7d271f4527cd_add_layer_column_in_layerv1_table.py +2 -2
- c2cgeoportal_commons/alembic/main/809650bd04c3_add_dimension_field.py +2 -2
- c2cgeoportal_commons/alembic/main/8117bb9bba16_use_dimension_on_all_the_layers.py +2 -2
- c2cgeoportal_commons/alembic/main/87f8330ed64e_add_missing_delete_cascades.py +2 -2
- c2cgeoportal_commons/alembic/main/9268a1dffac0_add_trigger_to_be_able_to_correctly_.py +2 -2
- c2cgeoportal_commons/alembic/main/94db7e7e5b21_merge_2_2_and_master_branches.py +3 -1
- c2cgeoportal_commons/alembic/main/951ff84bd8ec_be_able_to_delete_a_wms_layer_in_sql.py +2 -2
- c2cgeoportal_commons/alembic/main/a00109812f89_add_field_layer_wms_valid.py +4 -4
- c2cgeoportal_commons/alembic/main/a4558f032d7d_add_support_of_cog_layers.py +74 -0
- c2cgeoportal_commons/alembic/main/a4f1aac9bda_merge_1_6_and_master_branches.py +3 -1
- c2cgeoportal_commons/alembic/main/b60f2a505f42_remame_uimetadata_to_metadata.py +2 -2
- c2cgeoportal_commons/alembic/main/b6b09f414fe8_sync_model_database.py +174 -0
- c2cgeoportal_commons/alembic/main/c75124553bf3_remove_deprecated_columns.py +2 -2
- c2cgeoportal_commons/alembic/main/d48a63b348f1_change_mapserver_url_for_docker.py +2 -2
- c2cgeoportal_commons/alembic/main/d8ef99bc227e_be_able_to_delete_a_linked_functionality.py +2 -2
- c2cgeoportal_commons/alembic/main/daf738d5bae4_merge_2_0_and_master_branches.py +3 -1
- c2cgeoportal_commons/alembic/main/dba87f2647f9_merge_2_2_on_2_3.py +3 -1
- c2cgeoportal_commons/alembic/main/e004f76e951a_add_missing_not_null.py +2 -2
- c2cgeoportal_commons/alembic/main/e7e03dedade3_put_the_default_wms_server_in_the_.py +2 -2
- c2cgeoportal_commons/alembic/main/e85afd327ab3_cascade_deletes_to_tsearch.py +2 -2
- c2cgeoportal_commons/alembic/main/ec82a8906649_add_missing_on_delete_cascade_on_layer_.py +2 -2
- c2cgeoportal_commons/alembic/main/ee25d267bf46_main_interface_desktop.py +2 -2
- c2cgeoportal_commons/alembic/main/eeb345672454_merge_2_4_and_master_branches.py +3 -1
- c2cgeoportal_commons/alembic/static/0c640a58a09a_add_opt_key_column.py +2 -2
- c2cgeoportal_commons/alembic/static/107b81f5b9fe_add_missing_delete_cascades.py +2 -2
- c2cgeoportal_commons/alembic/static/1857owc78a07_add_last_login_and_expiration_date.py +2 -2
- c2cgeoportal_commons/alembic/static/1da396a88908_move_user_table_to_static_schema.py +3 -3
- c2cgeoportal_commons/alembic/static/267b4c1bde2e_add_display_name_in_the_user_for_better_.py +62 -0
- c2cgeoportal_commons/alembic/static/3f89a7d71a5e_alter_column_url_to_remove_limitation.py +2 -2
- c2cgeoportal_commons/alembic/static/44c91d82d419_add_table_log.py +6 -4
- c2cgeoportal_commons/alembic/static/53d671b17b20_add_timezone_on_datetime_fields.py +2 -2
- c2cgeoportal_commons/alembic/static/5472fbc19f39_add_temp_password_column.py +2 -2
- c2cgeoportal_commons/alembic/static/76d72fb3fcb9_add_oauth2_pkce.py +3 -1
- c2cgeoportal_commons/alembic/static/7ef947f30f20_add_oauth2_tables.py +3 -1
- c2cgeoportal_commons/alembic/static/910b4ca53b68_sync_model_database.py +186 -0
- c2cgeoportal_commons/alembic/static/aa41e9613256_wip_add_openid_connect_support.py +64 -0
- c2cgeoportal_commons/alembic/static/ae5e88f35669_add_table_user_role.py +2 -2
- c2cgeoportal_commons/alembic/static/bd029dbfc11a_fill_tech_data_column.py +2 -2
- c2cgeoportal_commons/lib/email_.py +15 -19
- c2cgeoportal_commons/lib/literal.py +3 -3
- c2cgeoportal_commons/lib/url.py +15 -16
- c2cgeoportal_commons/lib/validators.py +1 -1
- c2cgeoportal_commons/models/__init__.py +15 -8
- c2cgeoportal_commons/models/main.py +323 -228
- c2cgeoportal_commons/models/sqlalchemy.py +11 -10
- c2cgeoportal_commons/models/static.py +125 -76
- c2cgeoportal_commons/testing/__init__.py +10 -6
- c2cgeoportal_commons/testing/initializedb.py +7 -6
- {c2cgeoportal_commons-2.8.1.146.dist-info → c2cgeoportal_commons-2.9.0.350.dist-info}/METADATA +4 -9
- c2cgeoportal_commons-2.9.0.350.dist-info/RECORD +89 -0
- {c2cgeoportal_commons-2.8.1.146.dist-info → c2cgeoportal_commons-2.9.0.350.dist-info}/WHEEL +1 -1
- tests/conftest.py +1 -1
- c2cgeoportal_commons-2.8.1.146.dist-info/RECORD +0 -83
- {c2cgeoportal_commons-2.8.1.146.dist-info → c2cgeoportal_commons-2.9.0.350.dist-info}/top_level.txt +0 -0
c2cgeoportal_commons/__init__.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2014-
|
|
1
|
+
# Copyright (c) 2014-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
# pylint: disable=no-member
|
|
30
30
|
|
|
31
31
|
import logging.config
|
|
32
|
-
from typing import Any,
|
|
32
|
+
from typing import Any, cast
|
|
33
33
|
|
|
34
34
|
import sqlalchemy
|
|
35
35
|
from alembic import context
|
|
@@ -37,7 +37,7 @@ from c2c.template.config import config
|
|
|
37
37
|
from plaster.loaders import setup_logging
|
|
38
38
|
from sqlalchemy import engine_from_config, pool
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
_LOG = logging.getLogger(__name__)
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
# Interpret the config file for Python logging.
|
|
@@ -45,11 +45,15 @@ LOG = logging.getLogger(__name__)
|
|
|
45
45
|
setup_logging(context.config.config_file_name)
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
def get_config() ->
|
|
48
|
+
def get_config() -> dict[str, str | bool]:
|
|
49
49
|
"""Get the application configuration."""
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
app_cfg = context.config.get_main_option("app.cfg")
|
|
51
|
+
assert app_cfg is not None
|
|
52
|
+
config.init(app_cfg)
|
|
53
|
+
conf = config.get_config()
|
|
54
|
+
assert conf is not None
|
|
55
|
+
settings: dict[str, str | bool] = {}
|
|
56
|
+
settings.update(conf)
|
|
53
57
|
alembic_name = context.config.get_main_option("type")
|
|
54
58
|
schema_postfix = f"_{alembic_name}" if alembic_name != "main" else ""
|
|
55
59
|
schema_config_name = f"schema{schema_postfix}"
|
|
@@ -95,7 +99,7 @@ def run_migrations_online() -> None:
|
|
|
95
99
|
|
|
96
100
|
In this scenario we need to create an Engine and associate a connection with the context.
|
|
97
101
|
"""
|
|
98
|
-
conf:
|
|
102
|
+
conf: dict[str, Any] = get_config()
|
|
99
103
|
|
|
100
104
|
# Autogenerate config
|
|
101
105
|
alembic_name = context.config.get_main_option("type")
|
|
@@ -113,8 +117,8 @@ def run_migrations_online() -> None:
|
|
|
113
117
|
del name, reflected, compare_to
|
|
114
118
|
|
|
115
119
|
if type_ == "table":
|
|
116
|
-
return cast(bool, obj.schema == _schema)
|
|
117
|
-
return cast(bool, obj.table.schema == _schema)
|
|
120
|
+
return cast(bool, obj.schema == _schema) # type: ignore[attr-defined]
|
|
121
|
+
return cast(bool, obj.table.schema == _schema) # type: ignore[attr-defined]
|
|
118
122
|
|
|
119
123
|
if _schema:
|
|
120
124
|
conf.update(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2019-
|
|
1
|
+
# Copyright (c) 2019-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
Add technical roles.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2020-
|
|
1
|
+
# Copyright (c) 2020-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
+
# pylint: disable=invalid-name
|
|
29
|
+
|
|
28
30
|
"""
|
|
29
31
|
Remove the old is_expanded column.
|
|
30
32
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2015-
|
|
1
|
+
# Copyright (c) 2015-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
internal and external layer tables refactoring, new ogc table.
|
|
@@ -120,17 +120,17 @@ def upgrade() -> None:
|
|
|
120
120
|
op.execute(
|
|
121
121
|
f"INSERT INTO {schema}.layer_wms (id, server_ogc_id, layer, style, "
|
|
122
122
|
" time_mode, time_widget) "
|
|
123
|
-
"SELECT
|
|
124
|
-
f"FROM {schema}.layer_internal_wms AS
|
|
125
|
-
"WHERE
|
|
123
|
+
"SELECT layer.id, so.id, layer, style, time_mode, time_widget "
|
|
124
|
+
f"FROM {schema}.layer_internal_wms AS layer, {schema}.server_ogc AS so "
|
|
125
|
+
"WHERE layer.image_type=so.image_type AND so.type IS NOT NULL"
|
|
126
126
|
)
|
|
127
127
|
# internal with null image_type
|
|
128
128
|
op.execute(
|
|
129
129
|
f"INSERT INTO {schema}.layer_wms (id, server_ogc_id, layer, style, "
|
|
130
130
|
" time_mode, time_widget) "
|
|
131
|
-
"SELECT
|
|
132
|
-
f"FROM {schema}.layer_internal_wms AS
|
|
133
|
-
"WHERE
|
|
131
|
+
"SELECT layer.id, so.id, layer, style, time_mode, time_widget "
|
|
132
|
+
f"FROM {schema}.layer_internal_wms AS layer, {schema}.server_ogc AS so "
|
|
133
|
+
"WHERE layer.image_type IS NULL AND so.image_type='image/png'"
|
|
134
134
|
)
|
|
135
135
|
|
|
136
136
|
# ocg for externals
|
|
@@ -145,10 +145,10 @@ def upgrade() -> None:
|
|
|
145
145
|
op.execute(
|
|
146
146
|
f"INSERT INTO {schema}.layer_wms (id, server_ogc_id, layer, style, "
|
|
147
147
|
" time_mode, time_widget) "
|
|
148
|
-
"SELECT
|
|
149
|
-
f"FROM {schema}.layer_external_wms as
|
|
150
|
-
"WHERE
|
|
151
|
-
"AND
|
|
148
|
+
"SELECT layer.id, so.id, layer, style, time_mode, time_widget "
|
|
149
|
+
f"FROM {schema}.layer_external_wms as layer, {schema}.server_ogc as so "
|
|
150
|
+
"WHERE layer.url=so.url AND layer.is_single_tile=so.is_single_tile "
|
|
151
|
+
"AND layer.image_type=so.image_type"
|
|
152
152
|
)
|
|
153
153
|
|
|
154
154
|
op.drop_table("layer_external_wms", schema=schema)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2015-
|
|
1
|
+
# Copyright (c) 2015-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
+
# pylint: disable=invalid-name
|
|
29
|
+
|
|
28
30
|
"""
|
|
29
31
|
Merge 1.6 and master branches.
|
|
30
32
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2015-
|
|
1
|
+
# Copyright (c) 2015-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
Add image format to WMTS layer.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2014-
|
|
1
|
+
# Copyright (c) 2014-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
create database.
|
|
@@ -50,7 +50,7 @@ down_revision = None
|
|
|
50
50
|
class TsVector(UserDefinedType): # type: ignore # pylint: disable=abstract-method
|
|
51
51
|
"""A custom type for PostgreSQL's tsvector type."""
|
|
52
52
|
|
|
53
|
-
def get_col_spec(self) -> str:
|
|
53
|
+
def get_col_spec(self) -> str: # type: ignore[override] # pylint: disable=arguments-differ
|
|
54
54
|
return "TSVECTOR"
|
|
55
55
|
|
|
56
56
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2019-
|
|
1
|
+
# Copyright (c) 2019-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
Remove old metadata column.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2014-
|
|
1
|
+
# Copyright (c) 2014-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
Add restricted theme.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2019-
|
|
1
|
+
# Copyright (c) 2019-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
Remove v1 artifacts.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2014-
|
|
1
|
+
# Copyright (c) 2014-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
Update icons url.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2018-
|
|
1
|
+
# Copyright (c) 2018-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
trigger_on_role_updates_user_in_static.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2015-
|
|
1
|
+
# Copyright (c) 2015-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
Add description column in the tree.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2015-
|
|
1
|
+
# Copyright (c) 2015-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
+
# pylint: disable=invalid-name
|
|
29
|
+
|
|
28
30
|
"""
|
|
29
31
|
Merge 1.6 and master branches.
|
|
30
32
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2015-
|
|
1
|
+
# Copyright (c) 2015-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
Set layergroup_treeitem.id as a primary key.
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Copyright (c) 2024-2025, Camptocamp SA
|
|
2
|
+
# All rights reserved.
|
|
3
|
+
|
|
4
|
+
# Redistribution and use in source and binary forms, with or without
|
|
5
|
+
# modification, are permitted provided that the following conditions are met:
|
|
6
|
+
|
|
7
|
+
# 1. Redistributions of source code must retain the above copyright notice, this
|
|
8
|
+
# list of conditions and the following disclaimer.
|
|
9
|
+
# 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
10
|
+
# this list of conditions and the following disclaimer in the documentation
|
|
11
|
+
# and/or other materials provided with the distribution.
|
|
12
|
+
|
|
13
|
+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
14
|
+
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
15
|
+
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
16
|
+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
|
17
|
+
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
18
|
+
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
19
|
+
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
20
|
+
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
21
|
+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
22
|
+
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
23
|
+
|
|
24
|
+
# The views and conclusions contained in the software and documentation are those
|
|
25
|
+
# of the authors and should not be interpreted as representing official policies,
|
|
26
|
+
# either expressed or implied, of the FreeBSD Project.
|
|
27
|
+
|
|
28
|
+
# pylint: disable=invalid-name
|
|
29
|
+
|
|
30
|
+
"""
|
|
31
|
+
Update the OGC server for OGC API.
|
|
32
|
+
|
|
33
|
+
Revision ID: 2e57710fecfe
|
|
34
|
+
Revises: a4558f032d7d
|
|
35
|
+
Create Date: 2024-11-27 12:47:20.234376
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
from alembic import op
|
|
39
|
+
from c2c.template.config import config
|
|
40
|
+
|
|
41
|
+
# revision identifiers, used by Alembic.
|
|
42
|
+
revision = "2e57710fecfe"
|
|
43
|
+
down_revision = "a4558f032d7d"
|
|
44
|
+
branch_labels = None
|
|
45
|
+
depends_on = None
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def upgrade() -> None:
|
|
49
|
+
"""Upgrade."""
|
|
50
|
+
schema = config["schema"]
|
|
51
|
+
|
|
52
|
+
# Instructions
|
|
53
|
+
|
|
54
|
+
# default 'image/jpeg', 'image/png'
|
|
55
|
+
op.execute(f"UPDATE {schema}.ogc_server SET name = 'MapServer' WHERE name = 'source for image/png'")
|
|
56
|
+
op.execute(f"UPDATE {schema}.ogc_server SET name = 'MapServer_JPEG' WHERE name = 'source for image/jpeg'")
|
|
57
|
+
op.execute(
|
|
58
|
+
f"UPDATE {schema}.ogc_server SET url = 'config://mapserver/mapserv_proxy/MapServer?MAP=MapServer' WHERE url = 'config://mapserver'"
|
|
59
|
+
)
|
|
60
|
+
op.execute(
|
|
61
|
+
f"UPDATE {schema}.metadata SET value = 'MapServer' WHERE value = 'source for image/png' and name = 'ogcServer'"
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def downgrade() -> None:
|
|
66
|
+
"""Downgrade."""
|
|
67
|
+
schema = config["schema"]
|
|
68
|
+
|
|
69
|
+
# Instructions
|
|
70
|
+
op.execute(f"UPDATE {schema}.ogc_server SET name = 'source for image/png' WHERE name = 'MapServer'")
|
|
71
|
+
op.execute(f"UPDATE {schema}.ogc_server SET name = 'source for image/jpeg' WHERE name = 'MapServer_JPEG'")
|
|
72
|
+
op.execute(
|
|
73
|
+
f"UPDATE {schema}.ogc_server SET url = 'config://mapserver' WHERE url = 'config://mapserver/mapserv_proxy/MapServer?MAP=MapServer'"
|
|
74
|
+
)
|
|
75
|
+
op.execute(
|
|
76
|
+
f"UPDATE {schema}.metadata SET value = 'source for image/png' WHERE value = 'MapServer' and name = 'ogcServer'"
|
|
77
|
+
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2015-
|
|
1
|
+
# Copyright (c) 2015-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
Move exclude_properties from LayerV1 to Layer.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2016-
|
|
1
|
+
# Copyright (c) 2016-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
+
# pylint: disable=invalid-name
|
|
29
|
+
|
|
28
30
|
"""
|
|
29
31
|
Merge e004f76e951a and e004f76e951a heads.
|
|
30
32
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2018-
|
|
1
|
+
# Copyright (c) 2018-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
Remove trigger on_role_name_change.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2014-
|
|
1
|
+
# Copyright (c) 2014-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
Changes to start the implementation of the version 2.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2023-
|
|
1
|
+
# Copyright (c) 2023-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
+
# pylint: disable=invalid-name
|
|
29
|
+
|
|
28
30
|
"""
|
|
29
31
|
Add table log.
|
|
30
32
|
|
|
@@ -50,14 +52,14 @@ def upgrade() -> None:
|
|
|
50
52
|
|
|
51
53
|
op.create_table(
|
|
52
54
|
"log",
|
|
53
|
-
sa.Column("id", sa.Integer
|
|
55
|
+
sa.Column("id", sa.Integer, nullable=False),
|
|
54
56
|
sa.Column("date", sa.DateTime(timezone=True), nullable=False),
|
|
55
57
|
sa.Column("action", sa.Unicode, nullable=False),
|
|
56
58
|
sa.Column("element_type", sa.String(length=50), nullable=False),
|
|
57
|
-
sa.Column("element_id", sa.Integer
|
|
58
|
-
sa.Column("element_name", sa.Unicode
|
|
59
|
-
sa.Column("element_url_table", sa.Unicode
|
|
60
|
-
sa.Column("username", sa.Unicode
|
|
59
|
+
sa.Column("element_id", sa.Integer, nullable=False),
|
|
60
|
+
sa.Column("element_name", sa.Unicode, nullable=False),
|
|
61
|
+
sa.Column("element_url_table", sa.Unicode, nullable=False),
|
|
62
|
+
sa.Column("username", sa.Unicode, nullable=False),
|
|
61
63
|
sa.PrimaryKeyConstraint("id"),
|
|
62
64
|
schema=schema,
|
|
63
65
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2015-
|
|
1
|
+
# Copyright (c) 2015-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
add column time_widget.
|
|
@@ -35,6 +35,7 @@ Revises: 164ac0819a61
|
|
|
35
35
|
Create Date: 2015-04-27 17:31:41.760977
|
|
36
36
|
"""
|
|
37
37
|
|
|
38
|
+
import sqlalchemy
|
|
38
39
|
from alembic import op
|
|
39
40
|
from c2c.template.config import config
|
|
40
41
|
from sqlalchemy import Column
|
|
@@ -52,7 +53,7 @@ def upgrade() -> None:
|
|
|
52
53
|
# Instructions
|
|
53
54
|
for table in ["layerv1", "layer_internal_wms", "layer_external_wms"]:
|
|
54
55
|
op.add_column(table, Column("time_widget", Unicode(10), default="slider"), schema=schema)
|
|
55
|
-
op.execute(f"UPDATE {schema!s}.{table!s} SET time_widget = 'slider'")
|
|
56
|
+
op.execute(sqlalchemy.text(f"UPDATE {schema!s}.{table!s} SET time_widget = 'slider'"))
|
|
56
57
|
|
|
57
58
|
|
|
58
59
|
def downgrade() -> None:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2020-
|
|
1
|
+
# Copyright (c) 2020-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
+
# pylint: disable=invalid-name
|
|
29
|
+
|
|
28
30
|
"""
|
|
29
31
|
Add sql fields to vector tiles.
|
|
30
32
|
|
|
@@ -48,11 +50,11 @@ def upgrade() -> None:
|
|
|
48
50
|
"""Upgrade."""
|
|
49
51
|
schema = config["schema"]
|
|
50
52
|
table = "layer_vectortiles"
|
|
51
|
-
op.add_column(table, Column("sql", Unicode, nullable=True), schema)
|
|
53
|
+
op.add_column(table, Column("sql", Unicode, nullable=True), schema=schema)
|
|
52
54
|
|
|
53
55
|
|
|
54
56
|
def downgrade() -> None:
|
|
55
57
|
"""Downgrade."""
|
|
56
58
|
schema = config["schema"]
|
|
57
59
|
table = "layer_vectortiles"
|
|
58
|
-
op.drop_column(table, "sql", schema)
|
|
60
|
+
op.drop_column(table, "sql", schema=schema)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2015-
|
|
1
|
+
# Copyright (c) 2015-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
Add theme to full-text search.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2014-
|
|
1
|
+
# Copyright (c) 2014-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
Add ordering in relation.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2019-
|
|
1
|
+
# Copyright (c) 2019-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
Fix removing layerv1.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2016-
|
|
1
|
+
# Copyright (c) 2016-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
separate local internal.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2019-
|
|
1
|
+
# Copyright (c) 2019-2025, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
26
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
27
27
|
|
|
28
|
-
# pylint: disable=no-member
|
|
28
|
+
# pylint: disable=no-member,invalid-name
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
31
|
Add vector tiles layers table.
|