prompt-toolkit / prompt-toolkit/python-prompt-toolkit
Question: How to return key value from NestedCompleter?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 10.6k
- Forks
- 815
- PR merge metrics
- No merged PRs in 30d
Description
Hi, thanks for maintaining this package!
I want to read from a DB a nested structure of folders (name, ID, parentID), then create a NestedCompleter with this data showing the folder names as candidates, when the input process finishes I'd like to return the folder's ID like this:
Select the destination folder: folderA SubFolder DeepSubFolder
When the user press Enter after DeepSubFolder I wish to get DeepSubFolder's ID. I'm not interested in the name, I need the ID so I can refer to that folder in the database. I pretend to use the NestedCompleter as a way to help the user when navigating through the folder structure.
Currently I'm adding the ID after the folder names but probably there is a better way to do it.
Thanks!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the NestedCompleter API and its usage examples, focusing on how completed candidate values are returned. Compare that behavior with the requested database-folder ID workflow and determine whether an existing documented approach or a scoped API/documentation change is needed; done means the question has a clear supported answer.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100