Skip to content

Commit

Permalink
Populate domain options into graph tree #9501
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtylerwalls committed Dec 21, 2023
1 parent c609870 commit 98dd9cf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
13 changes: 13 additions & 0 deletions arches/app/models/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,19 @@ def add_node(self, node, nodegroups=None):

node.graph = self

if node.datatype in ("domain-value", "domain-value-list"):
node.config["i18n_config"] = {
"fn": "arches.app.datatypes.datatypes.DomainDataType",
}
node.config["options"] = [
{
"id": str(option.pk),
"text": dict(option.text),
"selected": option.selected,
}
for option in node.domain_values.all()
]

if self.ontology_id is None:
node.ontologyclass = None
if node.pk is None:
Expand Down
1 change: 0 additions & 1 deletion arches/app/models/migrations/9946_domainvalue.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def explode_configs(apps, schema_editor):
# cannot bulk_update(), raises NotImplementedError
dt.save(update_fields=["defaultconfig"])

# TODO: verify whether changes needed in cards_x_nodes_x_widgets or widgets?

def implode_configs(apps, schema_editor):
DDataType = apps.get_model("models", "DDataType")
Expand Down

0 comments on commit 98dd9cf

Please sign in to comment.