-
Notifications
You must be signed in to change notification settings - Fork 138
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
603: Always generate secondary instance for selects #614
Merged
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
faaf52a
wip: initial impl changes and test fixes - 27 tests still broken
lindsay-stevens ae54917
fix: error created but not raised
lindsay-stevens 4fa1f7d
fix: avoid output of duplicate translations, json dump, tests
lindsay-stevens ff31a6f
fix: lint
lindsay-stevens 66f8838
fix: remove unused xpath expressions
lindsay-stevens df4e01e
fix: upgrade fixture-based test for instance_xmlns setting
lindsay-stevens 0683836
fix: formatting
lindsay-stevens 7807e88
fix: import error due to local name vs. package namespaced name
lindsay-stevens f6df5b2
fix: translation test using incorrect test name param
lindsay-stevens 1238bd6
fix: xform2json choice filters support, minor codestyle improvements
lindsay-stevens c7caf44
add: type annotations
lindsay-stevens e5e21f5
fix: import path, add base method for non-question SurveyElement
lindsay-stevens c93d0a1
fix: remove debug output in some tests
lindsay-stevens 48c6f8e
fix: update comments in _setup_choice_translations for current behaviour
lindsay-stevens 42d7fd1
fix: exclude select with appearance=search() from itemset, test updates
lindsay-stevens acd7640
fix: minor correctness / off-by-one error in excel data processing
lindsay-stevens 2adb257
fix: tests for new itemset output for selects, add xls2json type hints
lindsay-stevens b23d704
fix: translation tests failing due to itemset changes
lindsay-stevens c2dd549
fix: test failure on Windows due to file encoding not specified in test
lindsay-stevens 751e4ea
fix: support of or_other with selects in itemsets
lindsay-stevens File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
output_context
is a way to save the node reference for cases where there areoutput
nodes so that${}
references can be expanded? I tried removing this scary bit of code andtest_convert_toJSON_multi_language
did fail. Then I set all places whereoutput_context
is set toNone
and some tests intest_repeat
failed. I don't understand why this works, though. I thought it would remove alloutput_context
values for all survey elements.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is reached by a call to
survey.to_json
so it shouldn't affect form conversion to XML.The purpose of
output_context
is to hold a reference to a SurveyElement, so that references like${}
can be expanded. In this case we're going from "internal PyForm" structures into JSON - so I don't know what the intended JSON representation ofoutput_context
should be (maybe a copy of the node dict?). Or maybe the JSON output should have the de-referenced output somewhere (e.g. a string containing XML). It seems like it needs a separate issue to design and implement, or document.Anyway, the problem at hand is that the node reference is a SurveyElement, which has a reference to it's parent Survey, which has references to it's child SurveyElements, which have references to the parent Survey, and so on. To break out of that loop,
output_context
is deleted so that survey.to_json() can return a document - it just would have the original referencing strings likeMy fav fruit is ${fruit}
, and de-referencing those is left to the caller.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aha, thank you, that's great to know.