Skip to content

feat: implement dict questions#2231

Open
dellekappa wants to merge 6 commits intocopier-org:masterfrom
dellekappa:feat_better_dict_questions
Open

feat: implement dict questions#2231
dellekappa wants to merge 6 commits intocopier-org:masterfrom
dellekappa:feat_better_dict_questions

Conversation

@dellekappa
Copy link

@dellekappa dellekappa commented Jul 10, 2025

Probably a better implementation for issue #751 compared to PR #2223

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 #751 is much more appealing, is also much harder to implement because requires to know in advance the questions that will be rendered

@dellekappa
Copy link
Author

@sisp any chance for reviewing this? I know it is a quite big implementation, but it will bring copier to the next level in my opinion.

Thanks for your awesome work

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.

1 participant