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

LIBFCREPO-1438. Modified Import "make-templates" to handle mapped hea… #311

Merged

Conversation

dsteelma-umd
Copy link
Contributor

…ders

Modified the "--make-template" functionality of the "import" command to handle model HEADER_MAPs with dictionary values containing "label" and "same_as" keys, which are converted to individual CSV header fields.

This was done by introducing a "parse_model_header_map" to the "plastron-cli/src/plastron/cli/commands/importcommand.py" file, and checking to see if the header value is a simple string, or a dictionary, and taking appropriate action. The "write_model_template" was then updated to use the new method.

Added a unit test using the "Item" model to verify functionality.

https://umd-dit.atlassian.net/browse/LIBFCREPO-1438

…ders

Modified the "--make-template" functionality of the "import" command
to handle model HEADER_MAPs with dictionary values, by adding each
value in the dictionary as a CSV header field (regardless of the key).

This was done by introducing a "parse_model_header_map" to the
"plastron-cli/src/plastron/cli/commands/importcommand.py" file,
and checking to see if the header value is a simple string, or a
dictionary, and taking appropriate action. The "write_model_template"
was then updated to use the new method.

Added a unit tests using the "Item", "Letter", "Poster", and "Issue"
models to verify functionality. This results in coupling between the
tests and the HEADER_MAP in each of the models, but hopefully it will
be simple to update the tests as needed as the header fields evolve.

https://umd-dit.atlassian.net/browse/LIBFCREPO-1438
@peichman-umd peichman-umd merged commit fc19c78 into umd-lib:release/4.3 Jun 13, 2024
1 check passed
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.

2 participants