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

Add concept to reference dt node migration #24 #28

Merged
merged 13 commits into from
Sep 30, 2024

Conversation

johnatawnclementawn
Copy link
Member

@johnatawnclementawn johnatawnclementawn commented Sep 5, 2024

Resolves #24
Should be preceded by #26

Copy link
Member

@jacobtylerwalls jacobtylerwalls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Some very minor feedback at your option, otherwise happy to merge this as is.

arches_references/management/commands/controlled_lists.py Outdated Show resolved Hide resolved
)
)

REFERENCE_SELECT_WIDGET = Widget.objects.get(name="reference-select-widget")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering if we should make this more resilient against widget renames. Should we use id? Or just filter on datatype and use the hardcoded one if present else an aribtrary one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, but I think for now it's okay. Currently the reference select widget handles both single and multi-select. The forecasts for folding other core datatypes into Arches-References are far away - I say we cross this bridge when we get there.

arches_references/management/commands/controlled_lists.py Outdated Show resolved Hide resolved
@@ -82,6 +105,8 @@ def handle(self, *args, **options):
overwrite=options["overwrite"],
preferred_sort_language=psl,
)
elif options["operation"] == "migrate_concept_nodes_to_reference_datatype":
self.migrate_concept_nodes_to_reference_datatype(options["graph"])

def migrate_collections_to_controlled_lists(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of scope for this PR, but I just ran into a case sensitivity thing, so it might have been nicer to do a looser match, e.g. value__lower__in=collections_to_migrate and then on the python side lower() everything in collections_to_migrate.

management.call_command(
"controlled_lists",
operation="migrate_concept_nodes_to_reference_datatype",
graph="b974103f-73bb-4f2a-bffb-8303227ba0da",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a follow-up ticket we could accept slugs, but not now. 👍

@jacobtylerwalls jacobtylerwalls removed their assignment Sep 26, 2024
@jacobtylerwalls jacobtylerwalls merged commit 8caa2dc into main Sep 30, 2024
5 checks passed
@jacobtylerwalls jacobtylerwalls deleted the 24_script_migration_concept_to_reference_nodes branch September 30, 2024 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create script for migrating graphs/nodes from concept to reference datatype
2 participants