Skip to content

Conversation

@dellekappa
Copy link

This PR relates to issue #751

Some reasoning follows:

  • implemented the question type dict that will be rendered, as expected, as a dict in jinja context. This is why I used dict instead of nested
  • on the answers file side, the answers are still a flat list that includes only the leafs of the question tree, but, to be able to traverse the question tree hierarchy, a classical property.property synthax has been used. Under the hood this is handled by dpath. This permits the user to easily specify an answer value from the command line at any hierarchy level.
  • the deepness in prompt have been rendered just with indentation. Even if what have been proposed in Add support for nested prompts #751 is much more appealing, is also much harder to implement because requires to know in advance the questions that will be rendered

Giulio Ruggeri added 2 commits July 3, 2025 17:47
@sisp
Copy link
Member

sisp commented Jul 9, 2025

Thanks for creating this PR to implement nested prompts, @dellekappa! 🙇 I'll give feedback ASAP.

@dellekappa
Copy link
Author

@sisp I made a new PR. It is internally a completely different implementation, much easier to mantain and more in line with this sentence in the #751 issue:

a nested question class could act as a container type that delegates asking/prompting to its children

implementing #750 on top of this would be much easier.

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