-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Smart 1 Improvements (t_type consistency and optimization strategy) #93
Conversation
…not a table created (like for smart1) only concern t_type option when it's relevant. concerning the selected strategy has to be implemented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, looks good to me.
The complexity here is a bit out-of-scope for me at the moment, I should really have a look at some MB documentation on polymorphic relations, optimization strategies, and the like. I'd appreciate if you can point me to some recommended resources (up-to-date docs, presentations, etc).
field_idx = ( | ||
fields.lookupField("T_basket") | ||
if not_pg | ||
else fields.lookupField("t_basket") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great to have a variable holding the correct basket field name regardless of the engine (e.g., fields.lookupField(BASKET_FIELD_NAME)
).
I'd have to refresh a bit how the Model Baker code has evolved to remember if this could be added as a class member. Just creating a note here in case you can think of something evident.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks I will concern that.
# check filter in widget | ||
ews = t_basket_field.editorWidgetSetup() | ||
map = ews.config() | ||
dataset_table = "T_ILI2DB_DATASET" if not_pg else "t_ili2db_dataset" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
if layer.layer.name() == "Strasse": | ||
count += 1 | ||
value_map = layer.layer.editFormConfig().widgetConfig( | ||
"T_Type" if not_pg else "t_type" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here
Yes, this first part was mainly about to provide the |
… and provide the baskets correctly
t_type
FieldGet possible values for
t_type
value relation for gpkg and mssql.This is done over the
t_ili2db_column_prop
table, where the values are provided for every system.With PG it used to parse the check constraint for that in
get_value_map_info
, not sure if this becomes obsolete now, but I keep it for the moment.Where this functionality is implemented claeis/ili2db#241
Where it was implemented differently for pg opengisch/QgisModelBaker#389
Where it has been discussed opengisch/QgisModelBaker#134
And this here resolves opengisch/QgisModelBaker#797
Beautify naming
Since the value in
t_type
used to be an sql-table name describing the class (but neither an existing table (because it's not created with smart1) nor a proper ili-name), it's now displayed as the Ili-Element-name.Optimize Strategy
With Smart1 a strategy named GROUP makes no sense: There is HIDE or NONE, while HIDE hides all the irrelevant values for
t_type
and provides only the relevant baskets.