Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use nice prefix for meta attribut form_order #89

Merged
merged 1 commit into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion modelbaker/dbconnector/gpkg_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,11 @@ def get_fields_info(self, table_name):
if record["fully_qualified_name"] != meta_attr["ilielement"]:
continue

if meta_attr["attr_name"] == "form_order":
if meta_attr["attr_name"] in [
"form_order", # obsolete
"qgis.modelbaker.form_order", # obsolete
"qgis.modelbaker.formOrder",
]:
record["attr_order"] = meta_attr["attr_value"]
attr_order_found = True

Expand Down
5 changes: 4 additions & 1 deletion modelbaker/dbconnector/mssql_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,10 @@ def get_fields_info(self, table_name):
if metaattrs_exists:
stmt += ln + "LEFT JOIN {schema}.t_ili2db_meta_attrs form_order"
stmt += ln + " ON full_name.iliname=form_order.ilielement AND"
stmt += ln + " form_order.attr_name='form_order'"
stmt += ln + " form_order.attr_name IN ("
stmt += ln + " 'form_order'," # obsolete
stmt += ln + " 'qgis.modelbaker.form_order'," # obsolete
stmt += ln + " 'qgis.modelbaker.formOrder')"
stmt += ln + "LEFT JOIN {schema}.t_ili2db_meta_attrs attr_mapping"
stmt += ln + " ON full_name.iliname=attr_mapping.ilielement AND"
stmt += ln + " attr_mapping.attr_name='ili2db.mapping'"
Expand Down
5 changes: 4 additions & 1 deletion modelbaker/dbconnector/pg_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,10 @@ def get_fields_info(self, table_name):
attr_order_field = "COALESCE(to_number(form_order.attr_value, '999'), 999) as attr_order,"
attr_order_join = """LEFT JOIN {schema}.{t_ili2db_meta_attrs} form_order
ON full_name.iliname=form_order.ilielement AND
form_order.attr_name='form_order'
form_order.attr_name IN (
'form_order', --obsolete
'qgis.modelbaker.form_order', --obsolete
'qgis.modelbaker.formOrder')
""".format(
schema=self.schema, t_ili2db_meta_attrs=PG_METAATTRS_TABLE
)
Expand Down
2 changes: 1 addition & 1 deletion modelbaker/generator/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def layers(self, filter_layer_list=[]):
meta_attrs = self.get_meta_attrs(record["ili_name"])
for attr_record in meta_attrs:
if attr_record["attr_name"] in [
"dispExpression",
"dispExpression", # obsolete
"qgis.modelbaker.dispExpression",
]:
display_expression = attr_record["attr_value"]
Expand Down
Loading