Not To Prompt Input Based on Previous Certain Input Value
See original GitHub issue- Cookiecutter version: 1.7.2
- Template project url: N/A
- Python version: 3.7.7
- Operating System: windows
Description:
I want to provide two database options to choose.
{
...
"database": [
"sqlite",
"postgres"
],
"db_user": "postgres",
"db_passwd": "password",
"db_addr": "127.0.0.1",
"db_name": "{{cookiecutter.app_slug}}"
}
But for sqlite, I don’t need to know these
{
"db_user": "postgres",
"db_passwd": "password",
"db_addr": "127.0.0.1",
"db_name": "{{cookiecutter.app_slug}}"
}
So how can I decide not to prompt these input based on certain input value?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:9
Top Results From Across the Web
Input prompt not returning to prior prompt after different failed ...
import module # Declaring the firstname lastname and raw_age type so that I can use global on them firstname = str lastname =...
Read more >Restrict value entry in cell based on another cell value in Excel
How to restrict value entry/input in a cell based on another cell value in Excel? Supposing you need to restrict value entry in...
Read more >Form Input Widgets Values Change based on Previous Inputs
During create data, I'm using a form where different input widgets are present for holding the end user data. The requirement is, prepopulate ......
Read more >Restrict data input by using validation rules - Microsoft Support
Validations rules help you check data as it is added to your Access desktop database which improves accuracy and consistency of data entry....
Read more >Solved: Initial input based on condition previous rows cel...
What I'm trying to achieve is based on a specific previous select is to auto populate (initial value) remaining questions based on the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@edesz @mockingjet
About your issue, I had the same issue and I solved it using the python library in a pre_gen hook, check below, on this case is to create or not a Datadog_synth test that need the variables. I hope it is useful for you.
cookiecutter.json
pre_gen_project.py
@Chobito unless you do something with the returned value, calling
cookiecutter.prompt.read_user_variable()
is useless because it’s just callingclick.prompt()
.