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

Generator option to expose t_ili_tid in project #72

Closed
wants to merge 1 commit into from
Closed
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
8 changes: 6 additions & 2 deletions modelbaker/generator/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def __init__(
mgmt_uri=None,
consider_basket_handling=False,
optimize_strategy=OptimizeStrategy.NONE,
expose_t_ili_tid=False,
):
"""
Creates a new Generator objects.
Expand All @@ -71,6 +72,7 @@ def __init__(
self._db_connector.new_message.connect(self.append_print_message)
self.basket_handling = consider_basket_handling and self.get_basket_handling()
self.optimize_strategy = optimize_strategy
self.expose_t_ili_tid = expose_t_ili_tid

self._additional_ignored_layers = (
[]
Expand Down Expand Up @@ -308,15 +310,17 @@ def layers(self, filter_layer_list=[]):
break

if column_name in IGNORED_FIELDNAMES:
hide_attribute = True
if not self.expose_t_ili_tid and column_name.lower() == "t_ili_tid":
hide_attribute = True

if not self.basket_handling and column_name in BASKET_FIELDNAMES:
hide_attribute = True

field.hidden = hide_attribute

if column_name in READONLY_FIELDNAMES:
field.read_only = True
if not self.expose_t_ili_tid and column_name.lower() == "t_ili_tid":
field.read_only = True

if column_name in min_max_info:
field.widget = "Range"
Expand Down
Loading