Accommodate Typed Relation Display name Fields - #810
Open
rosiel wants to merge 3 commits into
Open
Conversation
Contributor
Author
|
No tests yet, this is a proof of concept. |
rosiel
commented
Aug 8, 2024
| target_type = "taxonomy_term" | ||
| field_vocabs = get_field_vocabularies(config, field_definitions, field_name) | ||
| field_values = [] | ||
| subvalues = split_typed_relation_display_name_string( |
Contributor
Author
There was a problem hiding this comment.
I tried to make this class as short as possible as it inherits from TypedRelationField. This Class could be much shorter if we made the "split into subvalues" function a parameter of the class. In the create() and update() functions, the ONLY difference is using my custom "split_typed_relation_display_name_string" function.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to Github issue or other discussion
For my new module, Typed Relation with Display name, we need to alter Workbench to allow it to do what's needed to populate and export these new fields.
What does this PR do?
Adds support for Typed Relation field
What changes were made?
Duplicate existing class for TypedRelationField
Duplicate existing function for splitting the field value
Duplicate all invocations that test whether the field is a typed relation field.
Just to note that Workbench fails silently (no logs, no errors, just doesn't write to the field) if the field type is not recognized. While there is documentation for what fields are supported (will need to be updated?) I'm not sure if failing silently is the best option here? Open to discussion, just wanted to mention this.
How to test / verify this PR?
Interested Parties
@mjordan_
Checklist
setup.py?