docstrings
This commit is contained in:
parent
246f8b8cac
commit
f424ad25a4
1 changed files with 10 additions and 0 deletions
|
@ -34,6 +34,10 @@ class ListManager:
|
||||||
prefix: str,
|
prefix: str,
|
||||||
names: list[str] = Depends(lister.func),
|
names: list[str] = Depends(lister.func),
|
||||||
) -> list[str]:
|
) -> list[str]:
|
||||||
|
"""
|
||||||
|
Filters `names` from an async source for names starting with a given prefix.
|
||||||
|
"""
|
||||||
|
|
||||||
if isinstance(names, params.Depends):
|
if isinstance(names, params.Depends):
|
||||||
names = await lister.func()
|
names = await lister.func()
|
||||||
|
|
||||||
|
@ -45,6 +49,12 @@ class ListManager:
|
||||||
prefix: str,
|
prefix: str,
|
||||||
names: list[str] = Depends(_filter_fn),
|
names: list[str] = Depends(_filter_fn),
|
||||||
) -> str:
|
) -> str:
|
||||||
|
"""
|
||||||
|
Determines if a given prefix is unique in the async produced list `names`.
|
||||||
|
|
||||||
|
On success, produces the unique name with that prefix. Otherwise, throws a HTTPException.
|
||||||
|
"""
|
||||||
|
|
||||||
if isinstance(names, params.Depends):
|
if isinstance(names, params.Depends):
|
||||||
names = await _filter_fn(prefix)
|
names = await _filter_fn(prefix)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue